Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scraping digg rss feed with python

Tags:

python

is there a way to get the link from digg through its rss feed? or do i have to get the website and manually scrape it with a regex?

i want to get the real link digg points to, not to the comments feed, from rss.

example - http://feeds.digg.com/~r/digg/popular/~3/Hx0VATaafSw/Apple_Scaling_Final_Cut_Studio_Apps_to_Fit_Prosumers_2

goes to

http://www.appleinsider.com/articles/10/05/18/apple_scaling_final_cut_studio_apps_to_fit_prosumers.html

like image 957
Timmy Avatar asked Jul 22 '26 11:07

Timmy


1 Answers

Take a look at the feedparser module.

>>> import feedparser
>>> d = feedparser.parse('http://feeds.digg.com/digg/popular.rss')
>>> for entry in d.entries:
...     print entry.link
...
http://feeds.digg.com/~r/digg/popular/~3/Hx0VATaafSw/Apple_Scaling_Final_Cut_Studio_Apps_to_Fit_Prosumers_2
http://feeds.digg.com/~r/digg/popular/~3/mXb8b0QH3Rc/Skateboarder_Lives_Any_Man_s_Worst_Nightmare_video
http://feeds.digg.com/~r/digg/popular/~3/61N9gFUth1k/CBS_A_bloodbath_of_cancellations
http://feeds.digg.com/~r/digg/popular/~3/vZ3_6F1RAcI/Red_Dead_Redemption_Free_Roam_Done_Right
(snip)
like image 142
FogleBird Avatar answered Jul 24 '26 01:07

FogleBird



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!