Script to convert Twitter RSS feeds into text

[Update Nov 2012: URLs such as do not work anymore, but you can get a Twitter timeline RSS feed by using, where xxxxx is the screen name such as cnxsoft]

We needed to convert Twitter RSS feeds to UTF-16 text for displaying them into a digital signage (That did not support RSS feed directly).  This digital signage supports regular http download, .e.g every 5 minutes.

Here’s the script (called with crontab) we used for CNN News Twitter RSS feed.


# CNN Twitter
sleep 10
cat 759251.rss | grep title | sed s/\<title\>// | sed s/\<\\/title\>// > cnn.txt
rm 759251.rss
iconv -f utf-8 -t UCS-2LE cnn.txt > cnn-utf16.txt
cp cnn-utf16.txt /var/www/html/livepics/cnn.txt

The resulting text file looks like:

Twitter / CNN
CNN: BREAKING NEWS: Military: Last U.S. brigade combat team leaves Iraq; 56,000 troops remain. Fifty-thousand set to stay past August 31.
CNN: NY Gov. David Paterson discusses Islamic cultural center debate tonight at 9ET on &#8216;Larry King Live.&#8217;

and can be download using a URL, e.g.

This works with any Twitter feed including CNXSoft feed :).

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Notify of
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
Khadas VIM4 SBC