Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 09-04-2010, 11:05 AM   #1
mcphail
Junior Member
mcphail began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2010
Device: K3
[Old Thread] News auto download and email on headless server

Thanks, Kovid, for a wonderful piece of software.

I have been very impressed by the News download feature with automatic email to my Kindle. However I don't like leaving my noisy and power-hungry desktop on for scheduled downloads. I have a low-power Sheevaplug device which runs Debian Squeeze "headless" and I wonder if it would be possible to set a cron job to achieve this?

Can I invoke the command line tools to download and convert the Guardian and Glasgow Herald news sites as per the GUI? Sorry if this has been asked a million times before but I couldn't find anything on the forum...

Best wishes

NMP
mcphail is offline   Reply With Quote
Old 09-04-2010, 11:08 AM   #2
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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes you can.

ebook-convert title.recipe output.epub
kovidgoyal is offline   Reply With Quote
Advert
Old 09-04-2010, 11:12 AM   #3
mcphail
Junior Member
mcphail began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2010
Device: K3
How beautifully simple!

Thanks!
mcphail is offline   Reply With Quote
Old 10-31-2010, 11:49 AM   #4
Mixx
Zealot
Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.
 
Posts: 143
Karma: 387
Join Date: Sep 2010
Device: Kindle 3
I guess this is exactly what I, too, want to achieve on my Windows PC, but can not get it work (I have limited skills and might be aven unable to phrase the question correctly, I am sorry).

Could some kind soul please describe the steps needed to set up the following scenario (which seems to be in operation for a number of people here on the forum):

Windows PC /Vista running latest version of calibre. PC programmed using the task scheduler to wake up at 6:55am in the morning to run a batch file.

A number of news feeds set in Calibre to download every day at 07:00am.

PC will hibernate at 7:20am.

Questions:

Do I need to leave calibre running or can I use somehow Kovid's command line below to execute in a scheduled batch file? If I use that command line, are the programmed download times for the feeds immaterial?

If yes, how do I figure out the "title.recipe" parts for the news feeds? Do I take them from c:\Program Files\Calibre2\resources\recipes\xxx.recipe?

I suppose I can use "output.mobi" for the Kindle3. This creates a xxx.mobi file, but will the feed get emailed to the Kindle though? Or do I need to invoke this separately? Do I do that with calibre or via a command line email-instruction?

Can I have an arrangements such that *only* the news are mailed, other books are transmitted via USB?

Is there a way to put these feeds into a collection on the kindle? What happens to the older versions, do they get deleted after a while (can I control the time period?)

Does anyone have a batch file that can be modified and used?

Well, I apologize for this long list of questions, but I am desperate to get this working, it would be sooo convenient.

Thanks for any help,

Mixx

Last edited by Mixx; 10-31-2010 at 12:00 PM.
Mixx is offline   Reply With Quote
Old 11-01-2010, 12:15 PM   #5
Mixx
Zealot
Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.Mixx has a complete set of Star Wars action figures.
 
Posts: 143
Karma: 387
Join Date: Sep 2010
Device: Kindle 3
OK, with some time on my hands, I had a crack at this on the week-end. Some of you might find this useful, others will smile how simple this whole code is. Again, I have very little skills and Windows batch files are a challenge for me. I am sure one can write this in a much more elegant way. Still, I thought some might find the script useful anyway.

The following batch file works, I tested it. I schedule it with the Windows Task scheduler, which I configure such that it wakes up the PC from hibernation, when the time has come. At the end, the code sends the PC back to hibernation. This works once a day/week, as desired.

Calibre does not have to run, the batch is self contained, with calls to two command line utilities that come with Calibre. I also use the little free utility "timer.exe" for logging (see http://www.gammadyne.com/cmdline.htm#timer).

The frequency of download is determined only by the task scheduler, i.e. independent of the times you set in Calibre itself.

Code:
@echo off

set feeds=spiegelde zeitde cio technology_review npr

set recipes=C:\Program Files\Calibre2\resources\recipes
set workdir=S:\Ebooks\News

set server=smtp.gmail.com
set port=587
set user=myuserID@gmail.com
set pwd=mypassword
set mailserver=-r %server% --port %port% -u %user% -p %pwd%

set subject=News:
set text="Calibre News Feed %DATE% %TIME%"

set from=myuserID@gmail.com
set to=myKINDLEuserID@free.kindle.com

rem ----------------------------------------------------------------

chdir /d "%workdir%

echo %DATE% %TIME% Start Calibre News Feed > news.log
echo. >> news.log

for %%a in (%feeds%) do (

  timer /nologo > nul
  start /wait ebook-convert "%recipes%\%%a.recipe" "%%a.mobi" 
  start /wait calibre-smtp %mailserver% -a "%%a.mobi" -s "%subject% %%a" %from% %to% %text%
  del "%%a.mobi"

  echo %%a >> news.log
  timer /nologo /s >> news.log
  echo. >> news.log

)

echo %DATE% %TIME% End   Calibre News Feed >> news.log

C:\Windows\system32\shutdown.exe /h

exit 0
You define the desired feeds by setting the "feeds" list. It requires the *.recipe file names (without the extension) from the corresponding Calibre folder (set on the next line for my VISTA system).

Apart from the feeds, you specify your user ID-s and the password for smtp (I use gmail above) and off you go.

I hope this helps some forum members, unexperienced on Windows like myself.

Regards, Mixx
Mixx is offline   Reply With Quote
Advert
Old 11-02-2010, 01:11 PM   #6
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 377
Karma: 3557934
Join Date: Feb 2003
Device: Kindle Voyage, Kindle PW1, Kobo Glo HD, Nook Glowlight Plus ...
Thank you, that was very helpful.

I was able to set up a modified version of the file to do some different things. In the process, a few discoveries that may help others:

1. First, I'm not sure what purpose of putting "C:\Windows\system32\shutdown.exe /h" in was, so I've omitted it. (I guess it puts the system into hibernation)

2. Second, I found "call" worked better than "start /wait" --call runs in the same process, start opens a new one.

3. I discovered a bug in calibre-smtp (sort of): if you add -v to the settings (to see the output), calibre-smtp will fail if the attached file is too big--I guess the output buffer overflows. OK, so the answer is "don't set it to -v, you idiot" but the calibre-smtp function itself probably should have a check in it that just stops outputting a file to the scree after it gets too long.
slm is offline   Reply With Quote
Old 11-02-2010, 01:13 PM   #7
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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the output file size limitation is a limitation specific to the default windows console. Use a more capable console to get around it. I know of no way to reliably detect when a console can't handle long output.
kovidgoyal is offline   Reply With Quote
Old 11-14-2010, 04:01 AM   #8
usuario74
Junior Member
usuario74 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2010
Device: Kindle 3rd gen
Hi mcphail,

Did you get calibre running on your sheevaplug without a GUI?
Could you provide some information on how to do it?
Thanks

Quote:
Originally Posted by mcphail View Post
Thanks, Kovid, for a wonderful piece of software.

I have a low-power Sheevaplug device which runs Debian Squeeze "headless" and I wonder if it would be possible to set a cron job to achieve this?

NMP
usuario74 is offline   Reply With Quote
Old 11-18-2011, 12:00 PM   #9
misiaque
Junior Member
misiaque began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2011
Device: Kindle 3
I too am using Calibre on a Sheevaplug (Debian Squeeze OS). It's quite painfully slow at downloading and processing news, but it's working. To get it running, I've just downloaded and installed it using aptitude. It's in Debian repositories (version 7.7, so not the most recent one). Without GUI you can for example schedule news download and sending it by email to your Kindle. You can find instructions on the Web and here.
misiaque is offline   Reply With Quote
Old 11-19-2011, 03:50 AM   #10
carpetmojo
Wizard
carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.carpetmojo ought to be getting tired of karma fortunes by now.
 
Posts: 3,117
Karma: 9269999
Join Date: Feb 2011
Location: UK
Device: Sony- T3, PRS650, 350, T1/2/3, Paperwhite, Fire 8.9,Samsung Tab S 10.5
Wink

Quote:
Originally Posted by mcphail View Post
..... Debian Squeeze "headless" .....
NMP

Now there's a tabloid or Daily Enquirer headline for you ......

Poor chap, I hope they leave his family in peace.........
carpetmojo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre news server, download and send marsim Calibre 1 08-27-2011 07:31 AM
How do I configure the calibre content server to download news? fabian Library Management 18 04-24-2011 02:01 PM
another cannot email to kindle after fetching news thread harold1066 Calibre 7 12-16-2010 12:48 PM
Question about auto email for News Sischa Calibre 4 03-11-2010 11:14 AM


All times are GMT -4. The time now is 02:03 AM.


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