php

News, by Colour


I had a play around with the API and put together a really simple breakdown of news stories grouped by different colours - topics, articles and quotes relating to 'Red', 'Blue', 'Green' etc. It's at http://colours.isitbedtime.com.
 

 

It's written using PHP, and I put together my own wrapper built on top of the Zend Framework's Rest_Client with SimpleXML wrapping the responses. A combination of the Daylife API's simplicity and the Zend Framework code made accessing the data really easy, and what's returned is structured in a way that makes it really easy to make use of. I've made use of the Articles, Topics and Quotes searches and I pull in the thumbnail images for related topics.

In terms of the app itself, I was trying out different search terms to see what kinds of results were returned when using keywords that aren't the subject of the article but are just mentioned in it. I found quite quickly that for the most part colours did this. Some are better than others in showing this; Brown is really bad for it, as all the articles related to people with the surname Brown but the other colours show it pretty well.

One thing that could be improved, either in my code or preferably (because I'm lazy, and it's not a trivial problem to solve) in the API, would be some way to help eliminate stories that are duplicates - not that they're the exact same story, but that are covering the same thing. A lot of the time different perspectives are a good thing, but in the context of what I've done it's not desirable - newly discovered purple tomatoes being able to cure Cancer is dominating that topic at the moment, for example!