WikiSym Twitter Printer

by Ted Ernst on 9 September 2008

During WikiSym, anytime someone tweets the word WikiSym (anywhere, of course), it prints out on a very old, very loud, line printer (on continuous paper, of course).

WikiSym Twitter Printer

{ 9 comments }

Simon Dueckert 9 September 2008 at 7:17 am

Great Idea! How does this work?

mike 9 September 2008 at 9:52 am

This is a way cool idea!

Ward and I were looking at this picture yesterday and thinking about how we’d build an AboutUs tweet printer for the office.

pfctdayelise 9 September 2008 at 7:00 pm

How about identica? http://identi.ca/tag/wikisym

TedErnst 10 September 2008 at 8:34 am

Brianna, Does identica only work for #wikisym?

PS I’ve asked the WikiSym folks to comment here about how this actually works.

Andre Restivo 10 September 2008 at 12:42 pm

Hi,

Ted Ernst asked me to post a comment explaining how the wikisym twitter printer works. The code was written in about half an hour and is really terrible but the basic idea is captured in this simple script:

wget http://search.twitter.com/search.atom?q=wikisym
mv search.atom* last.xml
php twitter.php > toprint.txt
./print toprint.txt

The first line gets an xml file from twitter with the last 20 twits containing the word wikisym.

I didn’t have time to find how to make wget to save the contents of that URL into a file with a decent filename, so the second line just moves the result into a file called last.xml.

The third line calls a php file that reads the last.xml file and parses it. This file reads another file that contains the timestamp of the last twit printed and saves all twits with a timestamp bigger than that timestamp into a file called toprint.txt. The php script also updates the file containing the timestamp.

The fourth line call another script that prints the toprint.txt file into the LPT port.

That script is just this (i got this one somewhere in the net, sorry but i don’t have the reference):

[ "x$1" = "x" ] &”;
exit;
}
cat $1 > /dev/lp0

The whole thing was called every 60 seconds using the linux watch command:

watch -n 60 ./get_twits

If anyone wants I can send a zip with the complete set of files. But I double warn you. The code is just terrible :-)

André Restivo

Scott T. 12 September 2008 at 2:52 pm

You’re looking for the -O option for wget:

wget -O last.xml http://search.twitter.com/search.atom?q=wikisym

Or you could just use php’s built-in curl lib: http://us3.php.net/curl

Brion 21 September 2008 at 2:06 pm

I love it… we should get one for the office. ;)

Contabil 22 September 2008 at 6:53 am

Great idea! Old fashion stuff are in top of geek fashion nowadays!!! Very creative for sure!!!

TwitPrint.com 14 July 2009 at 4:44 am

We’ve made a different kind of Twitter printer! It’s actually a web service that formats all your tweets in a printer friendly way including Twitpic.com images and user avatars so you can print them.

Regards, TwitPrint.com

Comments on this entry are closed.

Previous post: Great view from the office.

Next post: The results are in!