This repository has been deprecated, but is being kept online to preserve course links.

For the latest content please see the repository at:
https://umd-ischool-inst326.github.io/inst326/

Exercise: Write an XML reader

Part 1 (10 points)

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

For each article (i.e. item), print the title and 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:

1. Pukemark, Sweatyrocks, Demonlick: Made-for-Amazon Brand Names Are Getting Ridiculously Surreal-  So many questions.
2. The Government Sued the Author of an Embarrassing Melania Trump Book Because … Christmas Ornaments Can Be State Secrets Too? - The first lady isn’t a government employee, so why is the Justice Department getting involved? That’s a good question.
3. Help! My Ridiculously High Standards Make It Difficult for Me to Find a Worthy Man. - It feels like I have a brick wall to break through when it comes to dating.
4. Trump-Fueled DOJ Probe Into Obama “Unmasking” Conspiracy Reportedly Comes Up Empty - Shocker.

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.

Part 2 (5 points)

You should display a * next to any article the user has NOT read If the user types a number to see an article, when the menu is displayed again the * should not appear next to that article. For example, your output may look like this to start:

1. *Pukemark, Sweatyrocks, Demonlick: Made-for-Amazon Brand Names Are Getting Ridiculously Surreal-  So many questions.
2. *The Government Sued the Author of an Embarrassing Melania Trump Book Because … Christmas Ornaments Can Be State Secrets Too? - The first lady isn’t a government employee, so why is the Justice Department getting involved? That’s a good question.
3. *Help! My Ridiculously High Standards Make It Difficult for Me to Find a Worthy Man. - It feels like I have a brick wall to break through when it comes to dating.
4. *Trump-Fueled DOJ Probe Into Obama “Unmasking” Conspiracy Reportedly Comes Up Empty - Shocker.

And if I read article #2, it would look like this after that:

1. *Pukemark, Sweatyrocks, Demonlick: Made-for-Amazon Brand Names Are Getting Ridiculously Surreal-  So many questions.
2. The Government Sued the Author of an Embarrassing Melania Trump Book Because … Christmas Ornaments Can Be State Secrets Too? - The first lady isn’t a government employee, so why is the Justice Department getting involved? That’s a good question.
3. *Help! My Ridiculously High Standards Make It Difficult for Me to Find a Worthy Man. - It feels like I have a brick wall to break through when it comes to dating.
4. *Trump-Fueled DOJ Probe Into Obama “Unmasking” Conspiracy Reportedly Comes Up Empty - Shocker.