Robot access

Re: Robot access

Postby salixzs » Sun Mar 21, 2010 4:16 pm

Hi.
I am implementing some widgets for e107 CMS engine my guild (and some more) uses for their online presence. (WowSite plugin)
I would like to have some mechanism of finding guild's ID by its 3 parameters: area (EU, US...), realm name and guild name.
It is not mission critical and no showstopper, it just would further enhance this beautiful possibility to have fast links to your site.
salixzs
 
Posts: 1
Joined: Sun Mar 21, 2010 4:10 pm

Re: Robot access

Postby Saltyone » Wed Apr 21, 2010 1:30 am

Would you be willing to wrap the JSON feed in 'callback()' to allow it to be parsed by JSONP? This would allow browsers to load the JSON feed cross-domain with <script> (such as jQuery.getJSON()).

If you attempt this using the above method, you get an "invalid label" error:

http://www.talkphp.com/javascript-ajax-e4x/1398-json-invalid-label.html
The problem here is likely that a string containing this apparent object literal definition is begin passed directly to the - eval - function and so is being interpreted as an entire javascript Program. The text of an object literal definition in the wrong context can be interpreted as a javascript Program. The surrounding braces become a Block statement, and the contained name value pairs then look like labelled expression statements...

"So basically the parenthesis stops JavaScript treating the JSON like an object literal"


This is basically XSS, so you may want to consider if that's good for your servers.
Saltyone
 
Posts: 1
Joined: Sat Feb 20, 2010 1:53 am

Re: Robot access

Postby Miles » Wed Apr 21, 2010 6:18 pm

It's is XSS yeah, as we can supply basically anything and it will execute in the context of the loading site... It's basically trusting us enough to use random <script> blocks from this place.

The thing is, I'm not sure I want to bear the risk of gibbing other websites with a bug in our code, or worse, with a security breach. The pure JSON thing is meant to be parsed server side; the beauty of JSON (not Javascript) is that the syntax is very strict and easy to validate, and it's pure data that cannot be executed.

I prefer going that route.
Miles
Site Admin
 
Posts: 1526
Joined: Mon Mar 30, 2009 7:12 pm

Re: Robot access

Postby shinuu » Wed Jul 21, 2010 3:15 am

I am working on creating an automatic parser that can download the dps totals for individual raid members. This would make it easier to compare changes across weeks. I am not very familiar with JSON however, which appears to be necessary as a raw html parse isn't working. Would anyone be kind enough to share with my an example of JSON script preferably in Java though I can probably find a way to convert it that does something similar.

Thanks for your help.
shinuu
 
Posts: 1
Joined: Wed Jul 21, 2010 3:06 am

Re: Robot access

Postby Maihem » Sun Jul 25, 2010 1:12 am

There is currently no feed for DPS numbers as far as I'm aware. If you're looking to fetch these numbers programmatically, be sure to read the licensing terms in the first post (basically, free for personal use only).

Given a report ID, the way I'd try to find DPS totals per fight is to parse the Compare Fights page and extract the fight links (css selector: #fights-table td.name a, xpath: //[id=fights-table]//td[2]/a), then take the href and textValue. Next, for each of the fights, fetch the href's url, parse and extract the character names and DPS values from the table.

Can I ask why parsing HTML isn't working for you?
Maihem
Site Admin
 
Posts: 2749
Joined: Sun Apr 05, 2009 4:14 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: Bing [Bot] and 2 guests