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

20
LINES

< > BotCompany Repo | #1000621 // getSnippetComments

JavaX fragment (include)

1  
static class Comment {
2  
  int user_id;
3  
  String user_name;
4  
  String text;
5  
}
6  
7  
static List<Comment> getSnippetComments(String snippetID) ctex {
8  
  Object json = jsonDecode(loadPage(tb_mainServer() + "/tb-int/get-comments.php?id=" + parseSnippetID(snippetID)));
9  
  //System.out.println("json: " + json);
10  
  new List<Comment> list;
11  
  for (Object _row : (List) json) {
12  
    Map row = (Map) _row;
13  
    new Comment c;
14  
    c.user_id = Integer.parseInt((String) row.get("author"));
15  
    c.user_name = (String) row.get("user_name");
16  
    c.text = (String) row.get("text");
17  
    list.add(c);
18  
  }
19  
  return list;
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, 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: 1093 / 1373
Version history: 1 change(s)
Referenced in: [show references]