views:

330

answers:

1

A page on a site I use is holding some of my data hostage. Once I have logged into the site and navigated to the right page, the data I need is in the array eeData[] - it is 720 elements long (once every 2 minutes of a given day).

Rather than simulate the requests to the underlying stuff json supplier and since its only once a day, I am happy to simply develop a bookmarklet to grab the data - preferably as a XML or CSV file.

Any pointers to sample code or hints would help.

I found a bookmarklet here that is based on this script that does part of this - but I am not up to speed on any potential JS file IO to see if it is possible to induce a file "download" of the data, or pop it opn in a new window I can copy / paste.

A: 

What are the datatypes of the objects in eeData? Converting arbitrary Object​s to a useful serialisation isn't doable in the general case; you would have to write your own JS function to inspect the objects and pick out the properties you wanted to serialise to whatever format.

But if they're simple Array​s and Object​s used as mappings, probably the quickest way to export them would be JSON. Use a browser with native JSON (eg. Firefox 3.5, IE8) and this bookmark:

javascript:document.body.innerHTML='<textarea id="t"></textarea>';void(document.getElementById('t').value=JSON.stringify(eeData));

then copy-and-paste the data out of the textarea.

bobince