Guest glossywhite Posted September 29, 2011 Report Posted September 29, 2011 Okay, so I wrote this nice little bash script, for grabbing current comments from the public Twitter timeline, and adding them to a text file: #!/bin/bash ## twitter public timeline grabber grab=`curl -s http://twitter.com/statuses/public_timeline.rss | grep title | sed -e 's/<title>//' | sed -e 's/<\/title>//' | sed -e 's/&#.*//'` if [ -f timeline.txt ]; then echo -e "current entries added at: " $(date) "\n\n $grab \n\n\n\n" >> timeline.txt else echo -e "current entries added at: " $(date) "\n\n $grab \n\n\n\n" > timeline.txt fi echo -e "\n\n ~~~ Twitter public timeline log updated & added to 'timeline.txt' at: " $(date) " ~~~" You'll need to chmod a+x this, and make sure 'curl' in installed! I just thought it would be fun to use, as I've recently started to learn a little regex (regular expressions) and 'sed' (stream editor - Google it!). I'm gonna add a crontab entry to poll the timeline every x minutes. Have fun!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now