Jump to content
Powerfrog

Refresh and scan data of website, show if within set parameters?

Recommended Posts

I'm basically thinking about a tool that could refresh specific webpages such as forum market places and analyse the data in specifically chosen fields, if the data is below a set amount it would present itself in some way (perhaps make a noise or pop up some text) to inform me.

 

For example it could be set to refresh http://forums.zybez....280-nature-rune every 10 minutes, and if it ever sees "Selling (>1000) for (<290)" it would let me know. A very useful merch tool.

 

Do you know if this is possible to create? And what would be the best thing to create it with?


CNqWHdA.jpg

Share this post


Link to post
Share on other sites

You can paste this into the JavaScript console in chrome:

 

var td;
var q;
var p = "";
tr = document.getElementsByTagName("tr");
for(var i = 0; i < tr.length;i++){
   td = document.getElementsByTagName("td");
   var temp = document.createElement("div");
   temp.innerHTML = td[i].innerHTML;
   var clean = temp.textContent || temp.innerText;
   if(clean.indexOf("Selling") > -1){
       clean = clean.replace("Selling","").replace(",","").replace(" for ","").replace(" GP","").replace("ea","");
       q = clean;
       for(var j = 0; j < 3; j++){
           p += q%10;
           q = Math.floor(q/10);
       }
       p = p.split("").reverse().join("")*1;
       q *= 1;
       if(p <= 290 && q >= 1000){
           alert("Selling " + q + " nature runes for " + p + "GP each.");
           td[i].style.backgroundColor    =    "#F4E23E";
       }
   }
   p = "";
}

Every time you run it, it will search for the offers that match those prices. I'd recommend using this as a foundation for a chrome app.

Share this post


Link to post
Share on other sites

Hi Hedgehog, that's excellent and does exactly what I asked for, I can see how to change the parameters to meet my needs. :)

 

I intend to create an application to run 100's of items automatically separate from the browser, hopefully directly from whatever database zybez uses rather than the actual web pages.


CNqWHdA.jpg

Share this post


Link to post
Share on other sites

Alright, if you want to build an application to check the prices of multiple items, the JavaScript I posted won't work very well.

If you want to interface directly with their storage (I'm sure they use XML or JSON, I don't think it's worth it for them to use a database for this), you'll have to get in contact with them. Then it's just a matter of downloading, parsing, and presenting the information.

Share this post


Link to post
Share on other sites

Check out the api, which is going to be a lot more reliable

 

http://forums.zybez....api/nature rune

Oh, they have an API. Yeah, it should be really easy to do this then. Just make sure that you parse the JSON using a JSON parser, not regex.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.