For my third and final 5K app for the £5 App competition I built a cut-down version of something I’ve been meaning to build for ages, which is part of the reason for having the 5K limit in the first place – it forces you to concentrate on the main point of a script or programme and leave out everything else.
At heart, the Article Suggester is a very simple application: you give it a bunch of text (for instance an article or blog post that you’re writing) and it will suggest a list of articles from the Guardian website.
Behind the scenes, things are slightly more complicated. When the form containing the text is submitted it’s first run through the Yahoo Term Extraction tool, which gives back a list of words and phrases it thinks are important from the text. The script then runs this list through the Guardian’s Open Platform content API and gets back a couple of articles related to each phrase, offering them up as links next to the submitted text to help with further research.
Try out the Article Suggester.
Both the Yahoo API and Guardian API have limits on their use, so if this gets popular it may not work. I’ll post up the source code soon so people can get their own API keys and extend it any way they want.
The code is written in PHP and uses SimpleXML to work through the data coming back from the APIs. Currently it’s only 2,292 bytes, so there’s loads of space left in the 5K, I just don’t have any time to add new bits before the competition presentation and judging on Monday.
If you’re interested in seeing the competition presentations, it’s happening at the Skiff from 8pm on Monday 20th April.