Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1002060 // bingMe function

JavaX fragment (include)

public static String bingMe(String command) {
  List<String> word = new ArrayList<String>();
  String url = "https://bing.com/search?q=";

  for (String singleWord : command.split(" "))
  {
      word.add(singleWord);
  }

  if (word.get(0).toLowerCase().equals("bing"))
            {
                for (int i = 1; i < word.size(); i++)
                {
                    url += urlencode(word.get(i)) + "+";
                }
                return url;
                
            }
  return "";
}

Author comment

Began life as a copy of #1002057

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, iveijnkanddl, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002060
Snippet name: bingMe function
Eternal ID of this version: #1002060/1
Text MD5: 408cc8b202ec1535becd74e764e3c27a
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-18 00:43:34
Source code size: 524 bytes / 20 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 694 / 917
Referenced in: #1002059 - Google Me & Bing Me Bot
#3000188 - Answer for stefanreich(>> t search)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)