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);
- // get All
- HashMap hm = (HashMap) sum[0];
- // get COmponent
- String title = hm.get("title");
- int nid = Integer.parseInt(hm.get("nid").toString());
- hashMap dummi = (HashMap) hm.get("field_link")[0];
- String filelink = Alamat+dummi.get("value");
- dummi = (HashMap) hm.get("field_price")[0];
- int price = Integer.parseInt(dummi.get("value").toString);
- //String fileLink;
- String body = hm.get("body");
- hasilnya.add(new nodeResult(title, nid, filelink, price,filelink,body));
- //}
- Gson gson = new Gson();
- String hasil = gson.toJson(hasilnya);
- Log.i("Ferry-code", hasil);
- return hasil;
- } catch (Exception e) {
- e.printStackTrace();
- //Gson gson = new Gson();
- //hasilnya.add(new jsonResult(e.toString(), nilaiku,e.toString()));
- //String hasil = gson.toJson(hasilnya);
- //Log.i("Ferry-code", hasil);
- return "error";
- }
Advertisement
Add Comment
Please, Sign In to add comment