Christian Heilmann

Posts Tagged ‘JSON’

flickr trackr – my first attempt and dabbling with the iPhone/iPod touch

Thursday, February 14th, 2008

I was pretty amazed when I got a thick envelope the other day from Apple. Steven Woolcock, the Safari Evangelist in Europe sent me an iPod touch to play with as I complained about not being able to test something he told me about. Now, as every other 12 year old boy on a sugar rush would have done I delved right into dabbling with the new toy and here’s my first result:

demo of a search on an iphone with flickrtrackr

The code is pretty dirty at the moment, but does the trick. Thanks must go to Steven for lending me the iPod Touch, David Dorward, Neil Crosby and Michele Gera for on-the-spot testing and Norm for giving me his phone for the screenshots.

What do you think? The whole thing is of course Creative Commons and you can download the source package.

Retrieving del.icio.us tags for the current URL with JavaScript

Monday, February 11th, 2008

If you scroll down the older entries of this blog you’ll see that there is a new feature, namely a box that shows reader tags and a link to del.icio.us:

Screenshot of a list of tags with a link to del.icio.us

This is not a WordPress plugin (although it would be easy to make and i’d be amazed if it hadn’t been done) but pure JavaScript. You can also download the script that does this and use the following to embed it in any page you’d like to know the delicious data for:




There is not much magic going on here, I basically souped up the example on the del.icio.us site,minified and embedded Paul Johnson’s implementation of MD5 in JavaScript and created the necessary HTML.

The HTML structure inside the DIV will be a definition list with tags as dd’s and the text as the dt and a paragraph with a link. You can style it by using the #deliciousinfo ID.

I like the outcome and I am always amazed what good tags readers of my stuff come up with. If you want to know, get the src commented version and check the information in there.

Shall I create a WordPress plugin for this?

Edit: if you wondered what the difference to the tagometer is, there isn’t much, I just forgot about it….

YUI 2.4.0 is out – CSS Selector engine, JSON support, dynamic CSS/script getter and lots more

Wednesday, December 5th, 2007

It is quite cool to see that your feedback is being implemented in something as big as the YUI. With every release the team excels itself building new components but also fixing and changing the existing ones.

Part of my job is to test the YUI for the European market (as we by default develop in 5 languages and encounter totally different issues) and in Asia (oh well, obvious that there are differences) and I am happy to say that all the problems we found got fixed and several of our suggestions implemented in this release.

While a lot of this is under the hood you can also see some new components in the 2.4.0 release:

  • Probably the most anticipated step is YUI getting a jQuery style CSS selector engine which allows you to quickly access the document without having how to traverse the Dom with native functions.
  • For those who need to work with numerical data a lot, the YUI now has a Flash charts component which allows you to create fancy pies and graphs easy
  • The new get utility is not the same as YAHOO.Dom.Get() but allows you to load scripts and CSS on demand after the page has been rendered by creating new nodes and having control over what has been loaded. This is quite handy in terms of page performances and I waxed lyrical over that in the past.
  • Those who love to take your Script to the garage and give them an intensive test-run will love the new Profiler which profiles JS in a browser environment
  • And last but not least we finally proclaimed our undying love to the JSON format by adding a new JSON component that allows you to stringify and validate JSON you retrieve either with dynamic script nodes or AJAX.

Again, under the hood, there are a lot of changes you cannot see but result in much better performance, especially in the DragDrop and the Rich Text Editor Control.

Dear API Developers, this is what I would like to have

Wednesday, November 7th, 2007

Jonathan Boutelle of Slideshare reacted to my slideshare show widget and liked how I hacked around the API by re-using the RSS feed. He now asked in the comments what I’d like to see from an API. Well, here goes:

  1. Allow for “hackable” URLs, with definition of the output. Flickr and Del.icio.us are good examples, especially the del.icio.us option of defining a callback for the JSON: http://del.icio.us/feeds/json/codepo8 gets me a JSON data wrapped in a Delicious object, http://del.icio.us/feeds/json/codepo8?raw gets me the raw JSON data and http://del.icio.us/feeds/json/codepo8?raw&callback=foo wraps it in a function call to foo(). This rocks! The same goes for defining the output as the last parameter. Flickr does that well – http://api.flickr.com/...format=json for JSON, http://api.flickr.com/...format=rss for RSS, http://api.flickr.com/...format=lol for LOLCAT
  2. make sure that the JSON output is easy to use and does not have any annoying bits (encoded HTML or namespaced attributes – the description property in the flickr JSON to me is pointless weight for example)
  3. make the URL as logical as possible, I don’t like to have to use the user ID in flickr for example when the readable user name would be easier to do.
  4. it’d be great if you could send a unique ID as a parameter as that would allow you to match returned data to calls (as both dynamically created script nodes and Ajax calls may return in any order)

However, all of this does not replace the real API, which should

  1. allow me to define only the data bits that I need (and cut down to the smallest possible feed – no twitter, 150kb JSON is not good!)
  2. give me extras when I go through a developer ID. How about offering me free stats (even as an own API) when I build a widget that uses my ID - we do this now to throttle usage anyways. In a second phase this could also be used for a revenue sharing program.
  3. offer things like enforced authentication (you know the photos you don’t want to show your mother)
  4. allow for local caching methods (deliver the data gzipped for example)
  5. allow me access to things that the open REST calls don’t (my sets, my favourites, my contacts, my profile settings)
  6. be read and write – I want to build widgets that allow data entry from my blog to your systems, without leaving it.

Anything else?