Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 08-18-2010, 06:39 PM   #2461
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
Question Still trying with AJC

Alright I put in what you said but I still don't appear to be getting the print version. I'm testing it using
ebook-convert myrecipe.recipe output_dir --test -vv

I still see the weather tags and search and so on so that is definately not the print version...

here is what I have so far....
Spoiler:

class AdvancedUserRecipe1282101454(BasicNewsRecipe):
title = u'AJC'
oldest_article = 1
max_articles_per_feed = 100
no_stylesheets = True
extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }'



feeds = [(u'Breaking News', u'http://www.ajc.com/genericList-rss.do?source=61499')
]


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


TonytheBookworm is offline  
Old 08-18-2010, 08:59 PM   #2462
cisaak
Member
cisaak began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2010
Device: Kindle DX
Quote:
Originally Posted by Starson17 View Post
The CODE tag is the hash mark/pound symbol on the toolbar when you're replying. The SPOILER tag is the eye with an X in it on the same bar. Just paste your code, highlight it, then hit the code button, followed by the spoiler button. The code tag preserves essential formatting. The spoiler tag compresses it so others don't have to see it all, even if it's long.
Only problem remaining is repeating article title. Here is my recipe.

Code:
cisaak is offline  
Old 08-18-2010, 10:07 PM   #2463
bhandarisaurabh
Enthusiast
bhandarisaurabh began at the beginning.
 
Posts: 49
Karma: 10
Join Date: Aug 2009
Device: none
Quote:
Originally Posted by kiklop74 View Post
I will not enter into discussion with ungrateful people. This is all the work I'm willing to do for this site for free. That is my final word.
sorry if I am asking for the print edition it doesn't mean I am ungrateful I am just asking for some changes in the recipe It's your wish to take as much time as you wish too
bhandarisaurabh is offline  
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  
Old 08-19-2010, 10:16 PM   #2465
elkosmas
Junior Member
elkosmas began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2010
Device: HTC Android using Aldiko
Hello guys... you are doing a great work with calibre
I inteded to post something on my website for calibre but I would like to post a recipe for my website (http://elkosmas.gr). I have made a simple recipe for me using the GUI but I think that's not really good enough.

My major concern is that althought I don't mind seeing Feedflares or other stuff on my feed... seeing it in a ebook is a major turnoff.
My other concern is that sometimes i tend to include embedded videos on my posts... when I do so i prefer to use a <More> tag in my RSS feed just before the video so people with low bandwidth connections can read the feed with ease.

The way i see it i prefer to provide just content (and some metadata to users) I also started translating some stuff to Greek thanks in advance.
elkosmas is offline  
Old 08-19-2010, 11:05 PM   #2466
rogeliodh
Member
rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.rogeliodh knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 14
Karma: 87858
Join Date: Dec 2009
Device: Kindle 3
La Jornada (México)

Hi, I've created a recipe for "La Jornada", a Mexican newspaper. I'm still working on it to fix some details, but it is usable right now.
Attached Files
File Type: txt la_jornada.v6.txt (5.5 KB, 293 views)
rogeliodh is offline  
Old 08-20-2010, 02:19 PM   #2467
JaneD
Addict
JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.
 
JaneD's Avatar
 
Posts: 322
Karma: 1057749
Join Date: May 2010
Location: LA, CA
Device: Kindle Paperwhite 2013
I used to have Dr Housing Bubble blog on a custom feed in calibre, but since I had to reload calibre onto my iMac, it doesn't work anymore. Now all I get are the headlines, no article follows. I've spent some time poring over the Users Manual but haven't been able to crack it. Any help is appreciated.

The feed is here: feed://feeds.feedburner.com/DrHousingBubble-HowILearnedToLoveSocal
JaneD is offline  
Old 08-20-2010, 03:56 PM   #2468
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 TonytheBookworm View Post
Alright I put in what you said but I still don't appear to be getting the print version. I'm testing it using
ebook-convert myrecipe.recipe output_dir --test -vv
You may want to test this way:
Code:
ebook-convert myrecipe.recipe output_dir --test -vv > myrecipe.txt
That will let you see any errors by looking at the text file..


Quote:
here is what I have so far....
[deleted recipe]
I still see the weather tags and search and so on so that is definately not the print version...

I tested your recipe and it's working correctly, after I added the required indents. If you read a few of the posts in this thread, you will see that it is essential to post using the code tags, which preserves indents. When you omit code tags, indents are removed from your post.

Here is what I tested - it's the same as your recipe, but with indents. Perhaps you really don't have any indents in your recipe? It's not possible to tell, which is why it's so important to post recipes in code tags.

Spoiler:
Code:
class AdvancedUserRecipe1282101454(BasicNewsRecipe):
    title = u'AJC'
    oldest_article = 1
    max_articles_per_feed = 100
    no_stylesheets = True
    extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }'
    
    feeds = [(u'Breaking News', u'http://www.ajc.com/genericList-rss.do?source=61499')
    ]
    
    def print_version(self, url):
        return url.partition('?')[0] +'?printArticle=y'


(Sorry for the delay in reply - I've been unable to post or test anything for the last couple days - a medical issue).
Starson17 is offline  
Old 08-20-2010, 04:10 PM   #2469
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 cisaak View Post
Only problem remaining is repeating article title. Here is my recipe.
You seem to have YOUTUBE tags on that recipe, but I was able to extract the code from the code tags. One of your H1 tags is inside an <a> tag so, assuming you don't need links try changing the remove_tags to this:

Code:
remove_tags = [dict(name='div', attrs={'id':'blox-logo'}),dict(name='a')]
You have a lot of overlapping remove and keep tags. You may want to use FireFox and FireBug to clean it up a bit, but it works as is.
Starson17 is offline  
Old 08-20-2010, 04:17 PM   #2470
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 TonytheBookworm View Post
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...
What I gave you works - I told you I tested it.
Quote:
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).
Do you notice that what I gave you has an indent, and what you've posted does not? I assumed that's because you didn't use the CODE tags, but if you really didn't use indents, that's your problem. It does work - I've tested it twice. If you want to see it for yourself, add a print statement before the return as in:
Code:
def print_version(self, url):
    print_url = url.partition('?')[0] +'?printArticle=y'
    print 'print_url is: ', print_url
    return print_url
Starson17 is offline  
Old 08-20-2010, 04:36 PM   #2471
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
Quote:
Originally Posted by Starson17 View Post
What I gave you works - I told you I tested it.

Do you notice that what I gave you has an indent, and what you've posted does not? I assumed that's because you didn't use the CODE tags, but if you really didn't use indents, that's your problem. It does work - I've tested it twice. If you want to see it for yourself, add a print statement before the return as in:
Code:
def print_version(self, url):
    print_url = url.partition('?')[0] +'?printArticle=y'
    print 'print_url is: ', print_url
    return print_url
yes the indent had to have been the issue cause as you stated which i didn't doubt but didn't understand why. It is working perfectly for me. Once again thank you so much for putting up with in this learning stage


I understood you said it worked. I wasn't doubting that at all. I just couldn't understand why it wasn't working on my end. I thank you very much for helping me out on this by the way. Sorry for any confusion or misunderstanding. And also, I hope your doing better as you mentioned you had a medical issue. Thanks again for your time and effort in this..

Last edited by TonytheBookworm; 08-20-2010 at 04:48 PM. Reason: update status
TonytheBookworm is offline  
Old 08-20-2010, 04:41 PM   #2472
jordanmills
Junior Member
jordanmills began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2010
Device: nook
Continuation of my texasmonthly saga:

I used examples and stuff to get articles out of the texasmonthly rss feed (ps, thanks starson17, your way is definitely better). I'm having trouble with authentication though. It looks like it's just not saving login info when it goes to the child pages.

This recipe pretty much does what I want for the non-subscription-only articles. If you remove the keep_only_tags and remove_tags, it will show the full web page and text indicating that the user is not logged in.

It might be because the RSS link is to a different domain... but it's more likely that I just didn't do something right. Could anyone assist? Thanks,
jordanmills is offline  
Old 08-20-2010, 04:51 PM   #2473
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 TonytheBookworm View Post
I understood you said it worked. I wasn't doubting that at all. I just couldn't understand why it wasn't working on my end.
Indents can be very frustrating. Notice how I send the errors to a text file - then I can see if it's reporting an indent problem.

Quote:
I thank you very much for helping me out on this by the way. Sorry for any confusion or misunderstanding.
You're welcome - I always love to see someone new attempting a recipe. When you get it finished, post it here.
Even though you are pulling the print_version, it still has some junk in it that you may want to remove.

Quote:
And also, I hope your doing better as you mentioned you had a medical issue.
Yes, I'm on the mend (again). The medical issue is why I started using Calibre - 1) I wanted something to read, but couldn't find it in my mess of disorganized files, and 2) it gave me time while immobile to read the code and play with Calibre.

Last edited by Starson17; 08-20-2010 at 04:58 PM.
Starson17 is offline  
Old 08-20-2010, 04:56 PM   #2474
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 jordanmills View Post
I'm having trouble with authentication though. It looks like it's just not saving login info when it goes to the child pages.

This recipe pretty much does what I want for the non-subscription-only articles. If you remove the keep_only_tags and remove_tags, it will show the full web page and text indicating that the user is not logged in.

It might be because the RSS link is to a different domain... but it's more likely that I just didn't do something right. Could anyone assist? Thanks,
Look at the last few posts by and to TonyTheBookworm, particularly about using ebook-convert. Get that set up with the recommended text file for errors, then post your recipe and the error file. Authentication is one of the trickier parts of recipe writing. The second trickiest part is probably multipage sites. You've picked a hard one to start on, but if you will put in the time, I'll work with you to get it done. Don't expect it to be quick

You may need to eventually disclose your user/pass to me by PM if we run into something that's really hard to solve - but let's try to avoid that.
Starson17 is offline  
Old 08-20-2010, 05:00 PM   #2475
jordanmills
Junior Member
jordanmills began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2010
Device: nook
Quote:
Originally Posted by Starson17 View Post
Look at the last few posts by and to TonyTheBookwork, particularly about using ebook-convert. Get that set up with the recommended text file for errors, then post your recipe and the error file. Authentication is one of the trickier parts of recipe writing. The second trickiest part is probably multipage sites. You've picked a hard one to start on, but if you will put in the time, I'll work with you to get it done. Don't expect it to be quick

You may need to eventually disclose your user/pass to me by PM if we run into something that's really hard to solve - but let's try to avoid that.
Hehe... actually I just found out yesterday that some of the articles are multipage... but only some. I know how to pick them!

I'll read up on that stuff by TonyTheBookwork and try a few other things before I try to get you to spend your time reinventing the wheel for me. I'll post back in a bit. Thanks!
jordanmills is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column read ? pchrist7 Calibre 2 10-04-2010 02:52 AM
Archive for custom screensavers sleeplessdave Amazon Kindle 1 07-07-2010 12:33 PM
How to back up preferences and custom recipes? greenapple Calibre 3 03-29-2010 05:08 AM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 01:54 AM.


MobileRead.com is a privately owned, operated and funded community.