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

20
LINES

< > BotCompany Repo | #1000621 - getSnippetComments

JavaX fragment (include)

static class Comment {
  int user_id;
  String user_name;
  String text;
}

static List<Comment> getSnippetComments(String snippetID) ctex {
  Object json = jsonDecode(loadPage(tb_mainServer() + "/tb-int/get-comments.php?id=" + parseSnippetID(snippetID)));
  //System.out.println("json: " + json);
  new List<Comment> list;
  for (Object _row : (List) json) {
    Map row = (Map) _row;
    new Comment c;
    c.user_id = Integer.parseInt((String) row.get("author"));
    c.user_name = (String) row.get("user_name");
    c.text = (String) row.get("text");
    list.add(c);
  }
  return list;
}
  

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

Comments [hide]

ID Author/Program Comment Date
514 #1000610 Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
static class Comment {
int user_id;
String user_name;
String text;
}

static List<Comment> getSnippetComments(String snippetID) ctex {
Object json = jsonDecode(loadPage("http://tinybrain.de:8080/tb-int/get-comments.php?id=" + parseSnippetID(snippetID)));
//System.out.println("json: " + json);
new List<Comment> list;
for (Object _row : (List) json) {
Map row = (Map) _row;
new Comment c;
c.user_id = Integer.parseInt((String) row.get("author"));
c.user_name = (String) row.get("user_name");
c.text = (String) row.get("text");
list.add(c);
}
return list;
}

}}
2015-08-18 18:44:27  delete 
512 #1000604 (pitcher) 2015-08-18 18:44:14

add comment

Snippet ID: #1000621
Snippet name: getSnippetComments
Eternal ID of this version: #1000621/2
Text MD5: 6fddce6d8e649abb6ad20c88d46ef866
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-26 13:24:04
Source code size: 615 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 617 / 790
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1000621 & http://1000621.tinybrain.de