2008OCT131320
Quick hack I'm working on. It
- grabs data in semi-realtime to server as JSON
- loads JSON data into browser as users mouse-over.
This is repeated for my flickr, hackernews, lastfm and delicious links. The test run you see here loads a pre-fetched json file using the flickr API to get the latest images I've uploaded. I update this list every couple of hours or so. Here the test data is simply a static file.
Sure the layout is borked (size etc). But you can see the image with the mouse run over it is constructed via the JSON file building a link with an image in the url with title and link. The result will be sort of real-time. The trade-off is data from my updated sites that will be current today, not necessarily the last minute.
The interesting bit is extracting the JSON file data and then writing the JQuery script in the $.document.ready function. Chaining works as you would expect and I've added the image to a url by identifying a unique image id (generated in Javascript at runtime). A lot to do but it shows me with a bit of preprocessing at the server
- python api request to flickr
- build & check valid JSON file
Then have a small Javascript library using my own tools that read JSON, build an array of objects then hand to JQuery to render a result.
I'll be writing a more detailed example showing how I used the flickr API with python, the resultant JSON file, JQuery and Firebug at a future date.
<<<< start
2008OCT131320
Quick hack I'm working on. It
- grabs data in semi-realtime to server as JSON
- loads JSON data into browser as users mouse-over.
This is repeated for my flickr, hackernews, lastfm and delicious links. The test run you see here loads a pre-fetched json file using the flickr API to get the latest images I've uploaded. I update this list every couple of hours or so. Here the test data is simply a static file.
Sure the layout is borked (size etc). But you can see the image with the mouse run over it is constructed via the JSON file building a link with an image in the url with title and link. The result will be sort of real-time. The trade-off is data from my updated sites that will be current today, not necessarily the last minute.
The interesting bit is extracting the JSON file data and then writing the JQuery script in the $.document.ready function. Chaining works as you would expect and I've added the image to a url by identifying a unique image id (generated in Javascript at runtime). A lot to do but it shows me with a bit of preprocessing at the server
- python api request to flickr
- build & check valid JSON file
Then have a small Javascript library using my own tools that read JSON, build an array of objects then hand to JQuery to render a result.
I'll be writing a more detailed example showing how I used the flickr API with python, the resultant JSON file, JQuery and Firebug at a future date.
<<<< start