View Single Post
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#4
@Demolition: I know this is not a js forum but I am building the app in Qt and it will be for maemo/meego

Originally Posted by mr id View Post
Looks like fairly standard JavaScript JQuery running in a browser :
var query
is a dynamically built string where
$("#daysBack").val()
is most likely the value inputted or held in the html form element with 'id="daysBack"'

$("#chartContainer").load("/statistics/typedistributionchart?" + query);
is then calling the url query and displaying the returned HTML in a visual element with an 'id=chartContainer'

If I were you I'd look at what:
http://THE_SITE/statistics/typedistr...111&daysBack=2
returns, assuming a valid user ID of course.

Does it return HTML? Will you need to parse out the bits you want from this markup? Does the site offer a cleaner way of getting this data?
From http://THE_SITE/statistics/typedistr...111&daysBack=2 I do get back a HTML file. That is the one containing the script. What is happening when I send the http://THE_SITE/statistics/typedistr...111&daysBack=2 to the server (from browser) is that i get a pop-up with a pie diagram wich shows me how much, in percent, I have been doing each training type.

here is a picture

I was in contact with the site owner before and his real api was quite limited to his own apps which were limited too. So this is the only way to go.

I figured out how to save the packets to a txt file so here is the packets from GET to response. After this packets a new GET comes(which was me changing daysBack).
http://pastebin.com/YjJ7Db27

Hope you guys understand this now!

Yours,