Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

getting G.E. prices with Google Spreadsheets

Featured Replies

Hello people, i wanted to make a profit calc ETC with google spreadsheets but i have the hardest time making it grab the prices.

=Index(ImportHtml(Concatenate("http://services.runescape.com/m=itemdb_rs/results.ws?query=guam"), "table", 1),4,3)

did not work, though this should work for the RS3 G.E. but it does not

 

the only way i hoped i could get it to work was via the find table thing as in the link above but the Oldschool RS G.E. 

 

6ckxlAn.png

 

it has a table but no link i could copy paste in

 

if i go to the iron ore itself

 

TysAVjm.png

 

now it isn't in a table it can grab the price from all i could find is that the price is between <h3> and </h3>

 

http://services.runescape.com/m=itemdb_oldschool/Iron_ore/viewitem?obj=440

 

thought it was simple just grabbing a price from the G.E. with google spreadsheets... but nope

 

all help will be appreciated :)

http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=3831

^ This is the OSRS ge API, there's also one for rs3


https://medium.com/@paulgambill/how-to-import-json-data-into-google-spreadsheets-in-less-than-5-minutes-a3fede1a014a


EDIT: doesn't seem to work quite well, so I wrote a custom function:
EDIT2: fixed comma issue

 

CELL FORMULA: =GetPriceRS3(<id>) or =GetPriceOSRS(<id>)




function GetPriceOSRS(id) {
  return GetPrice('http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=', id);
}

function getPriceRS3(id) {
 return GetPrice('http://services.runescape.com/m=itemdb_rs/api/catalogue/detail.json?item=', id);
}

function GetPrice(url, id) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  
  var response = UrlFetchApp.fetch(url + id);
  var data = JSON.parse(response.getContentText());
  

  price = (''+data['item']['current']['price']).replace(/,/g, "");
  if(price[price.length-1] === 'b') price = price.substr(0,price.length-1)*1000000000;
  else if(price[price.length-1] === 'm') price = price.substr(0,price.length-1)*1000000;
  else if(price[price.length-1] === 'k') price = price.substr(0,price.length-1)*1000;
  
  return parseInt(price);  
}

Edited by Flamezzz

  • Author

 

http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=3831

^ This is the OSRS ge API, there's also one for rs3

https://medium.com/@paulgambill/how-to-import-json-data-into-google-spreadsheets-in-less-than-5-minutes-a3fede1a014a

EDIT: doesn't seem to work quite well, so I wrote a custom function:

 

CELL FORMULA: =GetPriceRS3(<id>) or =GetPriceOSRS(<id>)




function GetPriceOSRS(id) {
  return GetPrice('http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=', id);
}

function getPriceRS3(id) {
 return GetPrice('http://services.runescape.com/m=itemdb_rs/api/catalogue/detail.json?item=', id);
}

function GetPrice(url, id) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  
  var response = UrlFetchApp.fetch(url + id);
  var data = JSON.parse(response.getContentText());
  

  price = data['item']['current']['price'];
  if(price[price.length-1] === 'b') price = price.substr(0,price.length-1)*1000000000;
  else if(price[price.length-1] === 'm') price = price.substr(0,price.length-1)*1000000;
  else if(price[price.length-1] === 'k') price = price.substr(0,price.length-1)*1000;
  
  return parseInt(price);  
}

 

got it working! thank you very much!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.