View Single Post
Old 08-01-2010, 08:31 PM   #2377
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 Flexicat View Post
Thank you!
You're welcome.
Quote:
I shall try to be tidier.
I hope I didn't sound too grumpy
Quote:
Here is my adjusted code:
Spoiler:

Code:
class AdvancedUserRecipe1280684448(BasicNewsRecipe):
    title          = u'Twisting the Hellmouth'
    oldest_article = 7
    max_articles_per_feed = 100

    feeds          = [(u'Latest', u'http://www.tthfanfic.org/rss.php')]

 def print_version(self, url):
        split1 = url.split("/")
        xxx = split1[3]
        split2 = xxx.split("-")
        artid =  split2[1]
        print "artid is: ', artid
        return 'http://www.tthfanfic.org/wholestory.php?no=' + artid + '&format=print'
It's almost perfect
Quote:
I get the error message

"ERROR: Invalid input: Could not create recipe. Error: unindent does not match any outer indentation level (recipe8.py, line 11)" when trying to update it.
You had a space in front of the def print_version. Python is picky about indents. I made a typo that you copied when I pasted in the quotes. Because you pasted in the code tags, (which preserves indents) I was able to easily spot it.

Try this:
Spoiler:
Code:
class AdvancedUserRecipe1280684448(BasicNewsRecipe):
    title          = u'Twisting the Hellmouth'
    oldest_article = 7
    max_articles_per_feed = 100

    feeds          = [(u'Latest', u'http://www.tthfanfic.org/rss.php')]

def print_version(self, url):
    split1 = url.split("/")
    xxx = split1[3]
    split2 = xxx.split("-")
    artid =  split2[1]
    print 'artid is: ', artid
    return 'http://www.tthfanfic.org/wholestory.php?no=' + artid + '&format=print'


Quote:
Also, what are the "numbers/subscripts" you mention? Are they the "/" marks in the URL?
I wasn't sure xxx = split1[3] was right, it might have been xxx = split1[4], but I've now checked them - the recipe ran OK.
Starson17 is offline