We are going to write a little RSS reader. RSS is
a
XML format that stores mostly current headlines on a news server. When
this file is downloaded and parsed you can get up to date information
from that website, or news source. It can also be used for other
information, but you will mostly find it on news sites, and other sites
that have frequent updates. In order to create this reader, there are
certain steps you will need to take, I have listed them here. All these
steps should be able to run depending only on the steps below them. So
I suggest you do one at a time.
Some example RSS files you can use are these:
The program will be run like this: ./rss.pl [URL
to RSS feed]
- 1. Execute a shell command to download the RSS file, and
store it in a temporary location. (hint: you can use wget)
- 2. Open a filehandle to the file saved in the temporary file.
- 3. Iterate through all lines in the file. (hint: use a while
loop)
- 4. For every line that you go through, use a regular
expression to find a <title></title> flag, and print the
information between them, on a new line every time. (hint: use the (.*)
operator)
- 5. Close the filehandle.