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

22
LINES

< > BotCompany Repo | #1000718 // Quick command-line snippet search

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (117L/2K/5K).

!636 (modern)

main {
  psvm {
    S s = join(" ", args);
    S page = loadPage("http://tinybrain.de:8080/tb/search.php?q=" + urlencode(s));
    
    // example string matched: ">#1000689</a> - processSilent function (hotwire and call for processing)<br>"
    //Matcher m = Pattern.compile(">#(\\d+ - .*?)</").matcher(page);
    Matcher m = Pattern.compile(">(#\\d+)</a> - (.*?)<br>").matcher(page);
    
    print("\n== Searched for " + quote(s) + ", best results last ==\n");

    new L<S> results;
    while (m.find()) {
      results.add(m.group(1) + " - " + m.group(2));
      if (results.size() > 10) break;
    }
    for (int i = results.size()-1; i >= 0; i--)
      print(results.get(i));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hxnwyiuffukg, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1000718
Snippet name: Quick command-line snippet search
Eternal ID of this version: #1000718/1
Text MD5: e3e9813bac718d9e184bb38f958906bd
Transpilation MD5: 10fd64949b5b5110da0b82a13d82f953
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-24 18:42:41
Source code size: 723 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 710 / 1207
Referenced in: #636 - Resolve symbolic translator invocations
#1000758 - Quick command-line snippet search (finds runnable programs only)
#3000188 - Answer for stefanreich(>> t search)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)