Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-06-2013, 02:38 PM   #1
darkheritage
Junior Member
darkheritage began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2013
Device: Kindle
So confused

I am completely new to this and completely lost. The local Nashville news paper the Tennessean provides a daily download already in mobi format. They read just fine on the Kindle.

http://nashvilletennessean.tn.newsme...&device=kindle

I can't however for the life of me figure out how to use calibre to automate the process instead of manually going to the papers site and downloading it daily.

I tried creating a recipe but that failed horribly.

Any suggestions?
darkheritage is offline   Reply With Quote
Old 12-21-2013, 11:25 AM   #2
scissors
Addict
scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.
 
Posts: 241
Karma: 1001369
Join Date: Sep 2010
Device: prs300, kindle keyboard 3g
As far as i know Calibre can'y go to a site and fetch a mobi file.
what it does is take (scrape) websites and throw out everything except the article.

if you go to http://www.tennessean.com/section/digital

the list of RSS feeds are at the bottom of the page
these URLs are what you add to the basic news recipe

example

Spoiler:
Code:
class AdvancedUserRecipe1387642952(BasicNewsRecipe):
    title          = u'test'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup = True

    feeds          = [(u'top news', u'http://www.tennessean.com/apps/pbcs.dll/section?prof=2275&Category=profilerss&mime=xml&nocache=1&rsstitle=TOP%20NEWS')]


Hope that helps, sorry that's all i can offer.

I recommend you read,

http://manual.calibre-ebook.com/news...asicNewsRecipe
scissors is offline   Reply With Quote
Advert
Old 01-04-2014, 07:23 AM   #3
aerodynamik
Enthusiast
aerodynamik doesn't litteraerodynamik doesn't litter
 
Posts: 43
Karma: 136
Join Date: Mar 2011
Device: Kindle Paperwhite
So confused

There is/was a few recipes downloading ePubs and using those. This should also work for mobi. There is sample code snippet here: https://www.mobileread.com/forums/sho...1&postcount=16

I think the German Zeit recipe used to do this.

I would offer to briefly look into this, but the link above requires a subscription. @darkheritage: let me know if you still need this, PM me your logon details and I can take a look what the best way should be

Last edited by aerodynamik; 01-04-2014 at 08:07 AM.
aerodynamik is offline   Reply With Quote
Old 11-09-2014, 07:12 AM   #4
mijairaf
Junior Member
mijairaf began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2014
Device: generic android
Hi

I am also having a tough time trying to use a Calibre recipe to download an epub from newsmemory.com. In my case the publication is the Fall River Herald News but I suspect the logic would be similar. I am able to download the epub file using a quick and dirty linux script that basically has 2 wget commands, the first wget does a post of the username and password, the second wget download the epub file.

I'm not a python developer so I really having a hard time implementing this as a recipe. I have read the tutorials and the posting about epub downloading from Starson17 and achims. But I'm not getting too far. Having cleared up initial indentation issues my recipe completes without errors but the epub is not downloaded.

I suspect my code is not even being invoked as I am unable to see the output of my print statements. Can anyone please get me repointed in the right direction ?

Here is the code I am using with the command:
ebook-convert frhn.recipe frhn -vvv --username myusername --password mypassword
Code:
class AdvancedUserRecipe1415485404(BasicNewsRecipe):
    title          = u'FallRiverHeraldNews'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup = True
    needs_subscription = True

    feeds          = [(u'Fall River Herald News', u'http://fallriverheraldnews.ma.newsmemory.com/ebook.php?page=downloadEbooks&device=android')]

def get_browser(self):
   br = BasicNewsRecipe.get_browser()
   print 'You have entered get_browser '
   if self.username is not None and self.password is not None:
     br.open('http://fallriverheraldnews.ma.newsmemory.com/ebook.php?page=downloadEbooks&device=android')
     br.select_form(name='Log in')
     br['USERID']   = self.username
     br['PASSWORD'] = self.password
     br.submit()
   return br

def build_index(self):
        print 'You have entered build_index '
	epub_url = "http://fallriverheraldnews.ma.newsmemory.com/ebook.php?page=downloadEbooks&device=android&date=20141109&token="
	url =  epub_url
	f = urllib2.urlopen(url)
	tmp = PersistentTemporaryFile(suffix='.epub')
	self.report_progress(0,_('downloading epub'))
	tmp.write(f.read())
	tmp.close()
	zfile = zipfile.ZipFile(tmp.name, 'r')
	self.report_progress(0,_('extracting epub'))
	zfile.extractall(self.output_dir)
	tmp.close()
	index = os.path.join(self.output_dir, 'content.opf')
	self.report_progress(1,_('epub downloaded and extracted'))
        print 'You have leaving build_index '
	return index
mijairaf is offline   Reply With Quote
Old 11-09-2014, 07:32 AM   #5
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,319
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your indentation is wrong. The methods of the class have to be indented so that they line up with the class attributes.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-09-2014, 10:10 AM   #6
mijairaf
Junior Member
mijairaf began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2014
Device: generic android
Thanks for that! I'm now making a bit of progress.
mijairaf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
confused? pjmc2 Introduce Yourself 6 03-13-2011 07:58 AM
confused edeyar Introduce Yourself 4 02-18-2011 08:48 AM
Confused sparky750 Which one should I buy? 2 07-31-2009 12:55 PM
I'm still so confused Jaie Which one should I buy? 11 02-02-2009 08:30 PM
Ok, I'm confused phenomshel HanLin eBook 6 01-27-2009 08:05 PM


All times are GMT -4. The time now is 09:19 PM.


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