Advertisement
DennisChrDk

GW2 Spidy API

Aug 22nd, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GetItemSellValue(itemID) {
  2.   var myUrl = "http://www.gw2spidy.com/api/v0.9/json/item/" + escape(itemID);
  3.   var jsonData = UrlFetchApp.fetch(myUrl);
  4.   var jsonString = jsonData.getContentText();
  5.   var jsonObject = JSON.parse(jsonString).result;
  6.   var adjustedValue = (jsonObject.min_sale_unit_price / 100);
  7.   return adjustedValue;  
  8. }
  9.  
  10.  
  11.   function GetItemBuyValue(itemID) {
  12.   var myUrl = "http://www.gw2spidy.com/api/v0.9/json/item/" + escape(itemID);
  13.   var jsonData = UrlFetchApp.fetch(myUrl);
  14.   var jsonString = jsonData.getContentText();
  15.   var jsonObject = JSON.parse(jsonString).result;
  16.   var adjustedValue = (jsonObject.max_offer_unit_price / 100);
  17.   return adjustedValue;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement