View Single Post
Old 08-19-2010, 09:03 PM   #2464
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
What would prevent get_printversion from finding a url in a rss feed and simply modifying it? I thought maybe def get_obfuscated_article(self, url): might be what I need to use. Cause when I look at the rss the links to the printversion simply need ?printArticle=y appended I just can't figure out for the life of me how to get this thing to feed in the links on the rss and simply modify it....
When i try this:
Spoiler:

def print_version(self, url):
return url.partition('?')[0] +'?printArticle=y'

I still get the non-print version as if the dang thing isn't modifying the link(s).

So I tried this,
Spoiler:

class AdvancedUserRecipe1282101454(BasicNewsRecipe):
title = u'AJC'
oldest_article = 1
max_articles_per_feed = 100
no_stylesheets = True
extra_css = ' body{font-family: Arial,Helvetica,sans-serif } '
feeds = [(u'Breaking News', u'http://www.ajc.com/genericList-rss.do?source=61499')
]

def get_article_url(self, article):
link = article.get('link')
if not link:
links = article.get('links')
if links:
link = links[0]['href']

return link

def print_version(link):
return url.partition('?')[0] +'?printArticle=y'


What i was hoping the above would do is sparse the rss feed for links. and sort them in a variable called link and then pass it into the print_version function using the parameter of link.

I'm probably way off but I'm trying to figure it out just need a little boost if someone minds helping a newbie.
TonytheBookworm is offline