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

19
LINES

< > BotCompany Repo | #1012419 // ai_downloadRelations

JavaX fragment (include)

static void ai_downloadRelations(S... relations) {
  for (S rel : relations) {
    Map map = cast loadJSONPage("http://smartbot.botcompany.de/json/relations/" + urlencode(rel));
    if (map.containsKey("loading")) fail("Smart Bot is loading");
    L<L<S>> data = (L) map.get("data");
    for (L<S> l : unnull(data)) {
      S globalID = (S) l.get(3);
      if (!ai_hasWeb(globalID)) {
        T3<S> t = listToTriple(takeFirst(3, l));
        Web web = webFromTriple(t);
        web.unverified = !eqGet(l, 5, "v");
        web.setGlobalID(globalID);
        web.source = (S) get(l, 4);
        print("Posting downloaded web: " + globalID + " " + webToStringShort(web));
        postSoftwareMadeWebAsSmartBot(web);
      }
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012419
Snippet name: ai_downloadRelations
Eternal ID of this version: #1012419/10
Text MD5: 87732c0eae0e042deb225b17fcf80c3d
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-02 17:23:41
Source code size: 750 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 371 / 398
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)