Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A slashdot headline grabbing script UNIX
This shell script parses the XML slashdot file and retrieves the latest headlines, based on the ThinkGeek quote retriever.

Installation
  1. Copy and paste this entire script into a plain text file.
    #!/bin/sh
    
    #Yold's Slashdot newsfeed reader
    
    echo "Current Slashdot Headlines" 
    curl -s http://slashdot.org/slashdot.xml | \
    sed -n -e '/title/p' | \
    sed -e 's/<[^>]*>//g' > /tmp/slash.txt
    cat /tmp/slash.txt | more
  2. Name the script slashreader.sh, save to your home directory.

  3. Open a terminal, and type chmod a+x ~/slashreader.sh to make the file executable.

  4. Add alias slashreader "sh ~/slashreader.sh" to your .cshrc file in your home directory.

  5. Type slashreader in the terminal
This will display a list of the current headlines, so you can see if there's anything new of interest you'd like to read.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,817 views]  

A slashdot headline grabbing script | 3 comments | Create New Account
Click here to return to the 'A slashdot headline grabbing script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
This script can get you banned
Authored by: f8dy on Apr 30, '03 01:58:44PM

Please please please do not do this. This will download Slashdot's entire RSS feed whether it has changed or not, which means you are wasting their bandwidth for no good reason. Think it doesn't matter? Slashdot is hugely popular, and it matters a great deal. Please use a real newsreader to read headlines, like NetNewsWire, which supports HTTP conditional GET and will only download feeds if they have changed.

The problem is so bad, using a script like this can get you banned from Slashdot. See: http://slashdot.org/faq/accounts.shtml#ac1050



[ Reply to This | # ]
A slashdot headline grabbing script
Authored by: ktohg on Apr 30, '03 02:08:17PM

A few notes. If you name the script without the .sh and place it in your path (/usr/bin /usr/local/bin) you do not need the alias

Also it is a good thing to mention that you should only curl slashdot.xml spraringly Especially if you plan on this being a fortune type MOTD. Since this is just a simple script you run when you feel like it really doesn't matter much. But if you are going to use it in an automated fasion it would be worth caching the xml file and only update it about once evey half hour.

more info on Slash Dot's XML policy.



[ Reply to This | # ]
Or just grab Slashdock
Authored by: Greedo on Apr 30, '03 03:06:12PM