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

19
LINES

< > BotCompany Repo | #1012419 // ai_downloadRelations

JavaX fragment (include)

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

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: 303 / 330
Version history: 9 change(s)
Referenced in: [show references]