Spring 2006 - Homework 5
Due: Friday, April 7th at 7PM
Quick Overview
Your assignment is to write a program that pulls headlinses from three websites: Digg (http://www.digg.com), Yahoo News (http://news.yahoo.com), and the Blake's news page (http://www.blakeohare.com/news/). After obtaining the headlines, you will generate an html page, with the headlines in a table.
Details, Details
- Your function should be named headlines (case sensitive) and your file should be named hw5.py
- Your function should take in a directory
- Your must use at least 2 functions
- Your function should generate a html file named headlines.html in the directory you chose.
- Rows: Your table should have 3 rows: one for each different news site. The first row should be headlines from Digg.com, the second row should be headlines from Yahoo News and finally the third row should contain headlines from Blake's News Site.
- The first column should have the appropriate heading based on where the headlines came from.
- Columns: Your table should have 5 columns.
Information for the Digg site
- For this site you want only the first 4 Digg headlines.
Information for Yahoo News
- Under the heading "More Stories" obtain the first 4 headlines.
Information for Blake's News
- For this site you also want the first 4 headlines.
Summary/Check off list
You will be graded on the following:
- Your function name and file are correct
- Your function takes in a directory
- Your function generates a html file named correctly
- You use at least two functions
- Your html file displays the required information in the correct order
- You have the correct number of headlines displayed
- Click here to see an example
How the TA will grade
Your TA, after loading your code into JES will type the following:
>>> directory = pickAFolder()
>>> headlines(directory)
Then your ta will navigate to the directory originally chosen and open the html file created.
At last extra credit
- 3 Points extra credit: Generate a table that has links back to the original stories. You'll need to extract the tag contents around the headline text and output new tags that contain URLs that point back to the original site.
- 3 points extra credit: For the digg site, instead of finding the first 4 headlines, find the first 4 headlines that have at least 200 diggs. Remember to include how many digs a particular headlines has as part as the headline title.
Questions?
Link to this Page