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 11-08-2014, 09:28 AM   #1
marcepa
Junior Member
marcepa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2014
Device: Galaxy Tab
Please help with collecting news with a Calibre task

Hi,
I am using Calibre to collect BBC news using the "collecting news" option to send them in a Kindle format to my tablet.
To do this I am using a Windows task which starts calibre-portable every morning - I have a planned task within Calibre to collect the news and send them. It works very well, except that once the Windows task has started it remains active and prevents opening any new standard instance of Calibre, with a curse from Python. I cannot do anything like converting e-books. I must first kill the task before being able to run Calibre.
If somebody has a clue, thank you in advance for your help. :-)
marcepa is offline   Reply With Quote
Old 11-08-2014, 12:00 PM   #2
marcepa
Junior Member
marcepa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2014
Device: Galaxy Tab
Thanks to the suggestions from this Forum software I have discovered option --shutdown-running-calibre. I think this should solve my problem.
Almost happy
Waiting to see tomorrow morning if everything is OK.
marcepa is offline   Reply With Quote
Advert
Old 11-08-2014, 02:59 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 10,392
Karma: 60950013
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
As an alternative to launching calibre, you can also retrieve News via the command line.

As a test I made the following batch file:
Code:
@Echo Off
setlocal

rem ======
rem Customization can be done here
rem news_file     output name for the ebook to be written too; if you might be running multiple retrivals at the same time
rem               ensure unique names are used
rem news_recipe   Recipe being retrieved. This can either be the name of a built-in calibre recipe (ie "The Toronto Star.recipe")
rem               or an actually recipe file. Custom recipes made by calibre are stored in the custom_recipes directory of the calibre preferences
rem               for instance C:\Users\Peter\AppData\Roaming\calibre\custom_recipes\Pocket_1000.recipe
rem               Remember, if either the recipe name or the custom recipe name contain spaces, enclose them in quotation marks
rem news_username if the recipe needs a userid specify it here
rem news_password if the recipe needs a password specify it here
set news_file=__thestar__.epub
set news_recipe="The Toronto Star.recipe"
set news_username=
set news_password=

rem If we need either a userid or password then add them to the command line
if not "%news_username%" == "" set news_userpwd=--username %news_username% 
if not "%news_password%" == "" set news_userpwd=%news_userpwd% --password %news_password%

Rem Ensure we're in the Windows temp directory
cd /d %temp%

Rem remove the existing news we might have downloaded
if exist %news_file% del %news_file%

Rem retrieve the news feed
ebook-convert %news_recipe% %news_file% %news_userpwd%

if not exist %news_file% goto :eof
Rem add the retrieved news to calibre
calibredb add %news_file%
and set it as a task for Windows to run.

If you want to use a custom recipe for the news to retrieve, they are stored in the custom_recipes directory within the calibre preferences directory. In my case this would be C:\Users\Peter\AppData\Roaming\calibre\custom_reci pes and have names like Pocket_1000.recipe

I've included a range of variables to let you specify things like the output name, the recipe, and username / password
PeterT is offline   Reply With Quote
Old 11-09-2014, 01:32 AM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,247
Karma: 83049305
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If the task runs only when the user is logged in, it should display the calibre GUI.
Tasks that run "whether the user is logged in or not" don't show the GUI.

If you want it to run even when you aren't logged in, then you can use a script for the task, which launches calibre, then does "timeout /t 900" or however many seconds you figure the job may take, then kills calibre with the --shutdown-running-calibre option automatically. Make sure you choose a time long enough for the job to complete!

I would start calibre say 3 hours before I wake up, then let it run for 3 hours, then quit, so:

Code:
:: these are 2 comment lines (windows kludge)
:: "start" is used so we don't wait for calibre to close before continuing
start calibre.exe
timeout /t 10800
calibre --shutdown-running-calibre

Last edited by eschwartz; 11-09-2014 at 01:35 AM.
eschwartz is offline   Reply With Quote
Old 11-09-2014, 08:57 AM   #5
marcepa
Junior Member
marcepa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2014
Device: Galaxy Tab
Thank you both for your advice.
I am using a standard recipe which suits my needs. I am also relying on the sending mechanism offered by Calibre.
I used to be a geek at a time when the word did not exist. Now I tend to keep things easy
By the way, my problem has been solved by running an other task with option shutdown :-)

Last edited by marcepa; 11-09-2014 at 09:01 AM.
marcepa is offline   Reply With Quote
Advert
Old 11-09-2014, 10:55 AM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,247
Karma: 83049305
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by marcepa View Post
Thank you both for your advice.
I am using a standard recipe which suits my needs. I am also relying on the sending mechanism offered by Calibre.
I used to be a geek at a time when the word did not exist. Now I tend to keep things easy
By the way, my problem has been solved by running an other task with option shutdown :-)
One double task, two separate tasks, same difference.
eschwartz is offline   Reply With Quote
Old 11-09-2014, 02:05 PM   #7
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 10,392
Karma: 60950013
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Heck or my approach with one task which works whether calibre is running or not.
PeterT is offline   Reply With Quote
Old 11-09-2014, 02:37 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,247
Karma: 83049305
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by PeterT View Post
Heck or my approach with one task which works whether calibre is running or not.
Yours doesn't email the news at the end.
eschwartz 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 and Windows 7 Task Schedule problem. JayKindle Calibre 51 05-25-2014 04:02 AM
Collecting information? kindleBunny Amazon Kindle 2 12-18-2012 03:14 AM
Collecting device stats nickredding Calibre 9 12-12-2011 11:25 PM
Run Calibre as Task in Windows 7 nchall114 Calibre 10 04-22-2010 11:29 AM
Standalone Server(linux) version just for collecting news? bigreat Calibre 8 02-25-2010 02:03 PM


All times are GMT -4. The time now is 12:14 PM.


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