Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Original script:
- function GetItemSellValue(itemID) {
- var myUrl = "http://www.gw2spidy.com/api/v0.9/json/item/" + escape(itemID);
- var jsonData = UrlFetchApp.fetch(myUrl);
- var jsonString = jsonData.getContentText();
- var jsonObject = JSON.parse(jsonString).result;
- var adjustedValue = (jsonObject.min_sale_unit_price / 100);
- return adjustedValue;
- }
- Separate connections:
- function GetItem(itemID) {
- var myUrl = "http://www.gw2spidy.com/api/v0.9/json/item/" + escape(itemID);
- var jsonData = UrlFetchApp.fetch(myUrl);
- var jsonString = jsonData.getContentText();
- return jsonObject;
- }
- function GetItemExchangeValue(jsonObject) {
- return(jsonObject.min_sale_unit_price / 100)
- }
- GW2 v2 API:
- function Test(itemID) {
- var myUrl = "https://api.guildwars2.com/v2/commerce/exchange" + escape(itemID);
- var jsonData = UrlFetchApp.fetch(myUrl);
- var jsonString = jsonData.getContentText();
- var jsonObject = JSON.parse(jsonString).result;
- var adjustedValue = (jsonObject.exchange /100);
- return adjustedValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement