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 07-28-2010, 04:09 PM   #2356
fuquaforlife
Junior Member
fuquaforlife began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2010
Device: sony
Download articles since the last time I downloaded

Hi!

Loving recipes for my ereader. Question -- is there a way to only download articles since the last time I downloaded? Or even (for example) parse through say the last few days of downloaded articles and toss out everything that is before the last time I downloaded? I hope that made sense

If this has been done before, perhaps someone can point me in the direction of a recipe where it has been done? Preferably of an RSS feed, since those are easier for me to decode and reverse engineer. I looked through a bunch of postings, but didn't see anything.

Thanks!!
fuquaforlife is offline  
Old 07-28-2010, 04:54 PM   #2357
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 fuquaforlife View Post
Loving recipes for my ereader.
They are great aren't they!

Code:
Question -- is there a way to only download articles since the last time I downloaded?
That happens automatically - how could it d/l articles since before you last downloaded

Quote:
Or even (for example) parse through say the last few days of downloaded articles and toss out everything that is before the last time I downloaded? I hope that made sense
If you just search for tag:news before you download, you can delete all the old news. If you've already d/l'd then search for something like date:>=yesterday or date:>=5DaysAgo


OOPS! I was thinking you wanted to control the old EPUBs, not the old articles. There is some talk of adding a control for this - keeping track of previously downloaded articles, but it's not yet implemented. I agree it would be useful.

Last edited by Starson17; 07-28-2010 at 05:01 PM.
Starson17 is offline  
Old 07-28-2010, 04:56 PM   #2358
mwheinz
award-winning bozo
mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.mwheinz can program the VCR without an owner's manual.
 
Posts: 258
Karma: 172703
Join Date: Sep 2009
Location: Philadelphia
Device: Kobo Libra 2
Quote:
Originally Posted by fuquaforlife View Post
Hi!

Loving recipes for my ereader. Question -- is there a way to only download articles since the last time I downloaded? Or even (for example) parse through say the last few days of downloaded articles and toss out everything that is before the last time I downloaded? I hope that made sense
As far as I know, no - calibre doesn't compare the articles you're seeing in the rss feed with the articles you've already downloaded.

The only thing I could suggest is setting the limit to ignore articles more than 1 day old and then setting calibre to download new articles every day.
mwheinz is offline  
Old 07-28-2010, 05:17 PM   #2359
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,380
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's on the todo list.
kovidgoyal is online now  
Old 07-28-2010, 07:20 PM   #2360
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
New REcipe: They Draw and Cook

I seem to specialize in comics and food recipes. This is a bit of both! Food recipes in graphic form. Enjoy!
Attached Files
File Type: zip DrawAndCook.zip (1.0 KB, 294 views)
Starson17 is offline  
Old 07-28-2010, 07:21 PM   #2361
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
New Recipe: They Draw and Cook

Deleted as a dupe.
Starson17 is offline  
Old 07-28-2010, 10:15 PM   #2362
Elevatorguy
Junior Member
Elevatorguy began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2010
Device: none
It would be great if someone could make a recipe for the show me city St. Louis Post-Dispatch & STLtoday.com, I use Instapaper to load individual articles, thanks.
Elevatorguy is offline  
Old 07-29-2010, 12:36 PM   #2363
fuquaforlife
Junior Member
fuquaforlife began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2010
Device: sony
Quote:
Originally Posted by Starson17 View Post
They are great aren't they!

If you just search for tag:news before you download, you can delete all the old news. If you've already d/l'd then search for something like date:>=yesterday or date:>=5DaysAgo

OOPS! I was thinking you wanted to control the old EPUBs, not the old articles. There is some talk of adding a control for this - keeping track of previously downloaded articles, but it's not yet implemented. I agree it would be useful.
Thanks for quick response! I was afraid I wasn't being clear. Perhaps an example would be easier -- suppose I downloaded the news from the Washington Post on Wednesday at 2:30pm. And then the next day I downloaded the news from the Post 10am.

a) Side question: If I set it to download for the days = 1, does it download everything since Wednesday 12am? Or does days = 2 do that? And is it since 12am, or the current time?

b) What I was hoping to do originally was be able to download everything from Wednesday 12am, lift the value that I last downloaded at 2:30pm, and toss everything from before Wednesday 2:30pm.

Sounds like its on the the to do list though! Awesome work -- now I'm trying to get my 72-year old dad hooked on recipes so he doesn't have to read the news on his laptop.
fuquaforlife is offline  
Old 07-29-2010, 01:07 PM   #2364
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 fuquaforlife View Post
a) Side question: If I set it to download for the days = 1, does it download everything since Wednesday 12am? Or does days = 2 do that? And is it since 12am, or the current time?
These are good questions. I've never looked closely enough to answer it. Why don't you test it and tell us all? I'd have to look at the code or test it to answer. I suspect it just compares the date, not the time, but that's just a guess. Personally, I never read every single recipe every day, so I like lots of overlap. I just read articles until I get to the ones I've already read.

Quote:
Sounds like its on the the to do list though!
I believe that what is contemplated is to track the URL for each article. If that URL/article has been fetched previously, it gets skipped. AFAIK, it wouldn't try to keep track of a specific time, as that is already implemented in terms of the number of days to fetch.
Starson17 is offline  
Old 07-29-2010, 08:28 PM   #2365
sark666
Connoisseur
sark666 began at the beginning.
 
Posts: 51
Karma: 10
Join Date: Jul 2010
Device: colognesbook
I'm trying to make my first recipe but I can't see why this isn't working:

Code:
class AdvancedUserRecipe1280289069(BasicNewsRecipe):
    title          = u'Metro Daily'
    oldest_article = 7
    max_articles_per_feed = 100

    feeds          = [(u'metro local', u'http://www.metronews.ca/Toronto/local/rss')]

    def print_version(self, url):
        baseurl='http://www.metronews.ca/ArticlePrint/' 
        split1 = string.split(url,"/")
        xxx=split1 [6]
        split2= xxx[0:5]
        s =  baseurl + split2
        return s
It's from metronews, a Canadian daily news publication.

A url story would look like:

"http://www.metronews.ca/toronto/local/article/587467--finally-someone-at-the-acc-does-well"

But you can just have the 6 digit identifer. And the print equivalent would be:

"http://www.metronews.ca/ArticlePrint/587467?language=en"

But you only need the 6 digit identifer. At first I was adding the language bit, but when it wasn't working I removed it.

I tried it as str.split and string.split. Can't see where else it's wrong.
sark666 is offline  
Old 07-30-2010, 08:49 AM   #2366
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 sark666 View Post
I'm trying to make my first recipe but I can't see why this isn't working:

Spoiler:
Code:
class AdvancedUserRecipe1280289069(BasicNewsRecipe):
    title          = u'Metro Daily'
    oldest_article = 7
    max_articles_per_feed = 100

    feeds          = [(u'metro local', u'http://www.metronews.ca/Toronto/local/rss')]

    def print_version(self, url):
        baseurl='http://www.metronews.ca/ArticlePrint/' 
        split1 = string.split(url,"/")
        xxx=split1 [6]
        split2= xxx[0:5]
        s =  baseurl + split2
        return s

It's from metronews, a Canadian daily news publication.

A url story would look like:

"http://www.metronews.ca/toronto/local/article/587467--finally-someone-at-the-acc-does-well"

But you can just have the 6 digit identifer. And the print equivalent would be:

"http://www.metronews.ca/ArticlePrint/587467?language=en"

But you only need the 6 digit identifer. At first I was adding the language bit, but when it wasn't working I removed it.

I tried it as str.split and string.split. Can't see where else it's wrong.
If you use string, you need to import it. You don't need it, however. Try:
split1 = url.split("/")
instead of
split1 = string.split(url,"/")

Also, check that your results are correct with a print, as in:
print 'split2 is: ', split2
right after you calc split2
Starson17 is offline  
Old 07-30-2010, 10:59 AM   #2367
Venkman
Junior Member
Venkman began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Nook
Hiya -

If someone would have the time to create a recipe for the Arizona Republic (http://www.azcentral.com/rss/feeds/news.xml), I would be grateful.

I've been trying to this myself, but after I get the idea of adding the feeds and adding the command "no_stylesheets = True", I don't understand what part of the article's/website's code does what to eliminate the unnecessary items or what commands eliminate which of these items.

I'm not a programmer and CSS just passed me by (I only know basic HTML). I don't mind if someone privately shares with me what to look for so I can learn how to do the job myself.

I've read the thread including the help documentation and it's like a foreign language to me - a flaw for sure.

Anyway, if anyone has the free time, thanks in advance. I'll try to figure some of this out as well.
Venkman is offline  
Old 07-30-2010, 11:32 AM   #2368
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 Venkman View Post
If someone would have the time to create a recipe for the Arizona Republic (http://www.azcentral.com/rss/feeds/news.xml), I would be grateful.

I've been trying to this myself, but after I get the idea of adding the feeds and adding the command "no_stylesheets = True", I don't understand what part of the article's/website's code does what to eliminate the unnecessary items or what commands eliminate which of these items.
I won't do it for you, but you sound like you're willing to learn, and I'll walk you through that - even if it takes longer

First, get FireFox or confirm you're using it and install FireBug. (needed to spot the stuff you want to remove when cleaning it up).

Second, post your current recipe (put Code then Spoiler tags around it).

We'll go from there.
Starson17 is offline  
Old 07-30-2010, 02:50 PM   #2369
sark666
Connoisseur
sark666 began at the beginning.
 
Posts: 51
Karma: 10
Join Date: Jul 2010
Device: colognesbook
Quote:
If you use string, you need to import it. You don't need it, however. Try:
split1 = url.split("/")
instead of
split1 = string.split(url,"/")
Haivng limited knowledge of python (but learning) I'm not sure what you mean if I use string I need to import it. I'll try without.

You also mentioned to try print to make sure it's chopping up correctly, well I tried in a python editor previously and it's chopping up the string as I expected. I'm just not passing it back properly.
sark666 is offline  
Old 07-30-2010, 03:04 PM   #2370
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 sark666 View Post
Haivng limited knowledge of python (but learning) I'm not sure what you mean if I use string I need to import it. I'll try without.
You would need this at the top of the recipe:
Code:
import string
Otherwise, your recipe doesn't know the string function.

Quote:
You also mentioned to try print to make sure it's chopping up correctly, well I tried in a python editor previously and it's chopping up the string as I expected. I'm just not passing it back properly.
If you didn't have string imported, it would have failed. Didn't you get an error message? I like to print the results when the recipe runs, then I can see if it's doing what I expect. I take print statements out only after it's all working.
Starson17 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 06:34 AM.


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