RAzer is an extra Python gadget behind the rear end of Media Circus.
The source text for Media Circus are ‘cutups’ of headlines, retrieved from RSS feeds of news agencies. Up until this month, I have been using an online php program called ”cutup“ that accesses feeds from the Toronto Globe and Mail and the CBC, cuts them up and re-presents them on a web page. The strategy for this program is simple: count the words in headline 1 and split it through the middle, do the same with headline 2, then combine the front of headline 1 with the back of headline 2, and vice versa.
RAzer retrieves headlines from 12 world sources and re-combines them by identifying common “join words”, such as ’in‘, ‘on’, ‘of’, ‘the’, ‘at’, ‘to’, ‘into’, ‘as’, ‘from’ and ‘over’. Like cutup, the interface is through the web, but in this case the user has a choice of join word, the number of headlines to generate, and whether or not to retrieve a fresh set of headlines. The form data is sent through a post action to a Python script on my little RaspberryPi.
I like number 8: EGYPTIAN COURT SENTENCES BROTHERHOOD LEADER TO LIFE IN DIGITAL CURRENCY.
And by the way, here’s another reason to own an RPi: although I’m very happy with my web hosting provider Hostgator, shared hosting accounts have a defined set of Python libraries that are installed, and you can’t add new ones. In the case of RAzer, I needed the feedparser library, which was not included, so I had to use my little guy.