Thread: Feed Elements
View Single Post
Old 12-12-2010, 11:08 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by mean_gene View Post
Anyone know the syntax for accessing the different feed elements?
There are 4 elements in an article of a feed - This will print them:
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
A Feed has a feed name and a list of articles. You set the feed name in the recipe.

Quote:
I'm guessing this is the title of the article:
curarticle.title
"title" is the title and "curarticle" is the article being processed in a loop - see above.

Quote:
Not sure what this is:
curarticle.title.upper
The title has been forced to upper case.

Last edited by Starson17; 12-12-2010 at 11:12 AM.
Starson17 is offline   Reply With Quote