View Single Post
Old 09-02-2010, 07:34 PM   #2605
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
Okay so the /printable append worked on the autoStuff but the webmaster for whatever reason can't seem to keep a constant format. So When it comes to the other feeds for example Computers. The dang url needs to be modified from..
http://feedproxy.google.com/~r/Howst...icroformat.htm
to this
http://computer.howstuffworks.com/mi....htm/printable


Sure I understand how to change it from previous recipes I have worked on and been helped with. Yet they were consistent. But in this recipe here it is a case of do this for some. then do this for some other then do this for something else. Do I some how call the feeds separately within the recipe ?

Like
Spoiler:

Code:
feeds          = [
                      ('AutoStuff', 'http://feeds.feedburner.com/HowstuffworksAutostuffDailyRssFeed')]

def print_version(self, url):
        return url + '/printable'

####now do some more feeds
feeds = [ 
('Computers', 'http://feeds.feedburner.com/HowstuffworksComputerstuffDailyRssFeed')]

def print_version(self, url);
    .......


This recipe here if anyone wants to tackle it with me is very confusing at least to me it is. Because like i say some of its feeds uses this then others use that. nothing stays the same.. Even with the printversion the formating doesn't stay the same like url + /printable in some cases it will be computer.howstuffworks.com/social-networking/blah.html instead of computer.howstuffworks.com/someothercrap/blah.html my guess would be some form of a regexpression... so without further flooding the forum about this recipe if someone out there doesn't mind tackling this by all means do I'm curious to know how you resolve this issue.... I will continue to work and play with it but again I don't wanna keep fooding the forum on this

thanks again


added*******
Is there something like a switch in python(beautifulsoup) ?
For instance
If Feed_title = Auto
then do this...
Else If Feed_title = computers
then do this...
Default
do this....

I think that would work in this situation because then for each individual feed I could have it do what it needs to do to get the printurl...

Last edited by TonytheBookworm; 09-02-2010 at 08:59 PM. Reason: added more question
TonytheBookworm is offline