12-12-2010, 10:35 AM | #1 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G/Wifi
|
Feed Elements
Anyone know the syntax for accessing the different feed elements?
There's a bit of info in the sample code sticky but it doesn't work (might be missing an import...feedparser?). I'm guessing this is the title of the article: curarticle.title Not sure what this is: curarticle.title.upper This is probably used for loops: curfeed.articles |
12-12-2010, 11:08 AM | #2 | |||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
def parse_feeds (self): feeds = BasicNewsRecipe.parse_feeds(self) for feed in feeds: for article in feed.articles[:]: print 'article.title is: ', article.title print 'article.url is: ', article.url print 'article.date is: ', article.date print 'article.text_summary is: ', article.text_summary return feeds Quote:
Quote:
Last edited by Starson17; 12-12-2010 at 11:12 AM. |
|||
Advert | |
|
12-12-2010, 12:04 PM | #3 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G/Wifi
|
Thanks for the quick response; that helps a lot.
Is "feed.title" the title of the feed? Also, does python care where I place the parse_feeds block of code (i.e. above/below the "feeds=[]" section) |
12-12-2010, 02:29 PM | #4 | ||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
|
||
12-12-2010, 03:48 PM | #5 | |
Enthusiast
Posts: 41
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G/Wifi
|
Quote:
|
|
Advert | |
|
12-12-2010, 05:21 PM | #6 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
12-12-2010, 07:31 PM | #7 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G/Wifi
|
Yeah I've been reading through the sticky code to get some ideas. I should have something working for me soon...
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
HTML5 elements in iPad magazines | Chang | Workshop | 5 | 06-22-2011 04:25 AM |
Styling Elements in CSS - ADE and Sony | toskpro | Sony Reader | 0 | 07-19-2010 01:55 PM |
Help me out: First use of these 4 sci-fi literary elements | Steven Lake | Writers' Corner | 7 | 12-31-2009 10:02 AM |
ePub elements pulled from the internet? | melisen | ePub | 1 | 12-08-2009 09:59 PM |
Windows 7 To Incorporate Multitouch Elements | NatCh | News | 22 | 05-29-2008 12:15 PM |