Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getNodeDetail(int nid){
- int nilaiku=0;
- String Alamat = "http://twitter.piecesofstory.com/";
- XMLRPCClient client = new XMLRPCClient(Alamat+"xmlrpc.php");
- ArrayList<nodeResult> hasilnya = new ArrayList<nodeResult>();
- try {
- Object sum = (Object) client.call("node.get", nid);
- Log.i("Ferry-code", sum.toString());
- // get All
- HashMap hm = (HashMap) sum;
- // get COmponent
- String title = hm.get("title").toString();
- Object[] dummi = (Object[]) hm.get("field_link");
- HashMap dummi2 = (HashMap) dummi[0];
- String filelink = dummi2.get("value").toString();
- dummi = (Object[]) hm.get("field_price");
- dummi2 = (HashMap) dummi[0];
- int price = Integer.parseInt(dummi2.get("value").toString());
- //icon path
- dummi2 = (HashMap) hm.get("files");
- Set set = dummi2.entrySet();
- Iterator k = set.iterator();
- Map.Entry me = (Map.Entry) k.next();
- dummi2 = (HashMap) me.getValue();
- String filepath = Alamat+dummi2.get("filepath").toString();
- String body = hm.get("body").toString();
- hasilnya.add(new nodeResult(title, nid, filepath, price,filelink,body));
- //}
- Gson gson = new Gson();
- String hasil = gson.toJson(hasilnya);
- Log.i("Ferry-code", hasil);
- return hasil;
- } catch (Exception e) {
- e.printStackTrace();
- return "error";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment