XML Homework

Write an XML reader.

Start by reading in the XML file from Slate: http://www.slate.com/all.fulltext.all.rss

Use XML::Bare to parse the RSS.

For each article (i.e. item), print the title and description, but strip out any HTML content from the description (i.e. get rid of the pesky HTML tags slate puts into the description). Number each from 1 to n, where n in however many articles there are.

Ask the user to choose an article to read. Here is an example of what your program might print:

*0. The Guy Who Turned Around Old Navy Is Taking Over for Ralph Lauren A tectonic shift is underway this evening in America’s fashion landscape: Ralph Lauren is stepping down as chief executive of his eponymous company, and Stefan Larsson, president of Old Navy, is taking over. *1. Campaign Quote of the Day: Tom Brady Has Second Thoughts About a President Trump New England Patriots quarterback Tom Brady explaining that his previous suggestion that it would be "great" if Donald Trump were president was just an "offhand comment" that shouldn't be mistaken as an official endorsement 2. Boehner Quitting Doesn’t Fix Anything The post–John Boehner shuffle in the House of Representatives is beginning to take shape as an outline of the future GOP leadership structure started to emerge on Tuesday. First, the current majority leader, Rep. Kevin McCarthy, is not facing any serious challengers for the speakership. (No offense meant to his one declared opponent, Rep. Daniel Webster, the third-term Floridian who’s reportedly distributing copies of his “Widgets, Principles and Republicans” treatise in an effort to woo colleagues.) *3. NFL Appeal in Brady Case Could Be Heard During Week of Super Bowl The good news for the NFL is that its request for an expedited appeal of the ruling that overturned Tom Brady's "Deflategate" suspension was just approved. The bad news for the rest of us is that the appeal now could be heard as early as Feb. 1, 2016—six days before the Super Bowl in Santa Clara, California. *4. Leonardo DiCaprio and Tom Hardy Battle to the Death in the Gruesome Trailer for The Revenant Leonardo DiCaprio and Tom Hardy are at each other’s throats in this new trailer for Alejandro González Iñárritu’s The Revenant. The film, shot in all-natural light in the Canadian and Argentine wilderness, tells the true story of Hugh Glass (played by DiCaprio), an explorer whose hunting party leaves him for dead after he’s mauled by a bear. Whereas the first trailer set the scene, this second installment shows the tension bewteen Glass, the fearless leader, and John Fitzgerald (Hardy), his resentful right-hand man. Enter a number to read that article: After the user selects a number, print out the following:
You can see that article at LINK
where LINK is replaced with the URL of the article taken from the link element of the rss feed.

Prompt the user to hit a key to continue, and print the list of articles again.

You should display a * next to any article the user has NOT read (notice the stars in the example above). If the user types a number to see an article, when the menu is displayed again the * should not appear next to that article.

The user should be able to quit your program and then run it again, and the program should remember which articles they have seen and which they have not. You will have to write out some information to a file to keep track of what the user has read, and load up that information again when the file is run. Keep in mind that the articles in the RSS feed might change (e.g. new articles may be added), so you should use some kind of unique idenitfier to keep track of the articles a user has read.

This is not a difficult task in terms of syntax, but it requires a lot of planning and thought. Work in bits and pieces - do not try to write this all at once!