My adventures with eBooks: Getting your favorite Newspaper/Magazine/Blog via calibre

So, the other day I rambled on at length about eBooks and a little program called ‘calibre’… While writing that post, I ended up thinking, “hey, why not make a series of posts?” So, here it is–post number two…

In the previous post I had mentioned that one of the neat features of calibre was its ability to grab feeds from sites and turn them into a nifty little eBook for you to enjoy. If you want to use one of the included “recipes”, the operation is fairly simple; if you want to go further and try to make your own recipe for collecting your local newspaper’s feed, you can do that, too!

Using included recipes

Clicking the “Fetch News” button in the toolbar will open a window where the user can select from a number of news/blog sources–all sources are grouped by language. Here’s a screenshot showing example of what’s available:

schedule_news_download

After you’ve found a source you like, it’s as simple as telling calibre that you want it, and how frequently. (Option exists for some sources–such as the New York Times, as shown above–where you can enter a username and pass, so that calibre can login and get the ‘whole’ article or otherwise restricted content, rather than the snippet.)

Neat, eh?

How about taking it a step further–and have your news delivered to you!

If you’ve setup your email address in the calibre preferences as a way to ‘share’ books–see ‘sharing books by email’–then you can have your selected news sources emailed to you! For the most part, this process is self-explanatory–as such, I’m not gonna give instruction; but if you need help, there’s always the calibre manual…

Adding your own news source

Okay, this is an advanced topic that I’m still working on myself–but I wanted to include it, anyway. Rather than attempting to go over the process, let me redirect you to the MobileRead Forum topic: Using News Recipes: Start Here; there’s also the calibre manual page: Adding your favorite news source.

Once you’ve given those pages a peek, you can start tearing your hair out while debugging your own recipes!

…as for me, I’ve tried creating two recipes, one for the Lexington Herald-Leader and one for the Cynthiana Democrat. The Herald recipe kind of works–I have issue with it throwing in duplicate content; the Democrat was working up until they fixed an issue where their RSS feeds somehow opened a backdoor into viewing subscribed content…

Delivering your news without running the calibre GUI

Ok, this one is more advanced–and there’s a good chance that there’s a better way to do it; but…

I don’t like the idea of leaving calibre running all the time, but I want to be able to have my morning news emailed to me; enter a little bit of batch programming, the calibre command-line tools, and Windows Task Scheduler.

First, I placed the recipes that I wanted to call in a separate directory. (you’ll see where in the batch file, below.

I then located an example of a batch program–http://www.mobileread.com/forums/showpost.php?p=1193772&postcount=5–and then toyed with it until I got what I’m using below (yes, I’m a lazy–I left unnecessary stuff there, just remarking them out):


@echo on

rem -- set preconfigured feeds --
rem -- old feeds: AP ArsTechnica CNN HuffingtonPost Reuters WashingtonPost Wired
set feeds=HeraldLeader NYtimes

rem -- set custom feeds --
set recipes=C:\Calibre Library\_NEWS
set workdir=C:\Calibre Library\_NEWS

rem -- set calibre dir --
set calibre=C:\Program Files\Calibre2

rem -- set for email delivery --
set server=smtp.gmail.com
set port=587
set user=user@gmail.com
set pwd=password
set mailserver=-r %server% --port %port% -u %user% -p %pwd%

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

set from=user@gmail.com
set to=user@gmail.com

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

rem chdir /d "%workdir%

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

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

rem timer /nologo > nul
call "%calibre%\ebook-convert" "%recipes%\%%a.recipe" "%%a.EPUB"
call "%calibre%\calibre-smtp" %mailserver% -a "%%a.EPUB" -s "%subject% %%a" %from% %to% %text%
rem call "%calibre%\calibredb" add --tags="News, %%a" "%%a.EPUB"
del "%%a.EPUB"

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

)

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

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

exit 0

Once I got that established, I launched Task Scheduler and set up times for Windows to launch the task. Voila! (albeit messy, and a half-assed job… but… I really don’t have any technical skills, and I do this sort of thing while keeping kids from killing each other!)

So, there it is, my second post on calibre!–more of an interest catcher than instruction/guide… but, hey, I’m sharing my adventures–hopefully yours will turn out better!

One thought on “My adventures with eBooks: Getting your favorite Newspaper/Magazine/Blog via calibre”

Comments are closed.