![]() |
Vanity Fair
I created a (fairly basic) recipe for Vanity Fair, and it seems to work pretty well as far as getting the full article content without "too much" extraneous stuff, but I would love if someone else who is better at this than I wants to run with it (i.e., adding covers, cleaning it up further, etc.). (Note, I also don't have the fourth VF RSS feed, relating to their Soccer Blog, in here, because I had no interest in it, but it obviously might be of interest to a more general audience)
Thanks! class AdvancedUserRecipe1283352306(BasicNewsRecipe): title = u'Vanity Fair' oldest_article = 7 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False feeds = [(u'The Latest From Vanity Fair.com', u'http://www.vanityfair.com/services/rss/feeds/everything.xml'), (u'VF Daily Blog', u'http://www.vanityfair.com/online/daily/rss.xml'), (u"Wolcott's Blog", u'http://www.vanityfair.com/online/wolcott/rss.xml')] def print_version(self, url): return url + '?printable=true' |
Quote:
For instance to get rid of the print options at the top use this in your code. I always put it before the feed section but you can put it pretty much anywhere inside the class block just make sure your indents are correct. you see when using firebug in firefox that the element you wish to remove is <div id="printoptions"> so the below will get rid of that. Spoiler:
As for the cover it depends on what cover you wish to use. Take again and use firefox and figure out what element of article (soup) you want to use as your image source. For instance lets say our cover is in the <div class="spread-image"> we would use something like this to get the image as the cover. Spoiler:
If however you want just a static cover (never changes) then simply take and put the following Code:
cover_url = 'PUT THE URL TO THE IMAGE HERE'good luck let me know if you need any help. just post your code and indicate where you seem to be having issues. also utilize ( Spoiler:
) without the ()'s of course. This will keep the thread cleaner and keep the formatting correct because python is picky about indents. |
Were you ever able to get this to work?
|
Quote:
|
| All times are GMT -4. The time now is 10:33 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.