Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2013, 02:31 PM   #1
zacclay
Member
zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'
 
Posts: 13
Karma: 10202
Join Date: Aug 2013
Device: Kobo N647
Post How-To: Get a Daily Digest of Your Unread Pocket Items on Any Kobo* (*I think)

Hello All,

I got a bricked Kobo Original WiFi (N647) from a friend, and after I revived it with some help from KevinShort , I decided to see what the coolest thing I could do with it was.

As many of you know, the new models of Kobo will come with pocket integration built in: engadget.

I thought this was an awesome new feature, because I already use pocket to save interesting articles I see at work so I can read them when I get home. I do IT and webdesign 8-4 so my eyes get pretty strained looking at a computer screen all day. So to me the idea of being able to read those articles later without the clutter and on an e-ink display would be a real life-saver.

So enough about me, onto the goods:

Every day at 4 pm, I have an ePub file wireless delivered to my kobo that has all the articles in my "pocket" marked as unread. Pretty cool if you ask me.

So, how do you do this?

It's a few steps, but I'll try to make it as simple as possible. This how-to should also work for any kobo device AFAIK. (please correct me if I'm wrong)

Step 1: "hack" your kobo to sync with a google drive account using the wonderful guide from this thread. This is the only place there would be a hang-up based on your kobo model, as everything else is web-based. (Side note: I also recommend setting up a separate Gmail account so you can email files to yourself and have them automatically added to your google drive, and therefore automatically added to your kobo. Use this guide)

Step 2: Get your Pocket unread rss feed. By default, this feed is password protected. You have to disable this by going to this link. Your unread rss feed will then be this:
Code:
http://getpocket.com/users/USERNAME/feed/unread
Just replace "USERNAME" with your username.

Step 3:Get the full text version of all the articles in your feed. To do this, go to FeedEnlarger and paste the unread rss feed you got in the last step into the "Enter partial feed URL" field. I would also then change the "Max items" to 10 (the maximum amount allowed) and click "create full text feed". It will redirect you to the new feed with the full text of the articles in your pocket feed. Just copy the whole url and paste it into a notepad, you'll need it later. Mine looks this:
Code:
http://feedenlarger.com/makefulltextfeed.php?url=getpocket.com%2Fusers%2Fzacclay%2Ffeed%2Funread&max=10&links=preserve&exc=&submit=Create+full+text+feed
*Note: Yes this service only allows the first 10 items, but I don't ever seem to need more than that, if anyone needs more, look around for other full-text rss feed generators, this one just seemed to work the best for me

Step 4: Set up your own personal rss parser. Oooh, how exciting!

4.a - Ok, all you need for this is a web server capable of running php scripts that doesn't have ads. I already had a server, but if you need a free one this one works just fine for what you need. Again, all you need is a tiny amount of server space with php and no ads, there's probably a few thousand sites that fit the bill.

4.b - After you get your server set up, grab the "rss.zip" file attached to this thread and unzip it. Inside are two files. rss_php.php is from the fine folks over at rssphp.net, you don't need to touch it.

The second file is index.php. All you need to do is open that file up in a text editor. I prefer notepad++, but to each their own. All you need to edit is on line 5 of the file. You just need to replace
Code:
$rss->load('PUT FULL TEXT RSS FEED HERE');
with your own FeedEnlarger url you got in step 3. Again, mine looks like this:
Code:
$rss->load('http://feedenlarger.com/makefulltextfeed.php?url=getpocket.com%2Fusers%2Fzacclay%2Ffeed%2Funread&max=10&links=preserve&exc=&submit=Create+full+text+feed');
4.c: Now, upload both those files to your server and go to wherever you put it. So if you signed up at 000webhost and got a subdomain like myname.net78.net, just upload those 2 files to public_html and then visit http://www.myname.net78.net/index.php. If you did everything right, you should just see some pretty boring looking plain text of the articles you saved in pocket. Save that URL for later.

4.d (Optional): I have the title (lines 21-24) for index.php set to My Pocket - current date. This is important because this will eventually end up being the title of your ePub file, and thus what you see in your kobo as the title. If you're comfortable with the code, you can edit this title to whatever you want.

Having fun yet?

Step 5: Get an ebookglue API key. Go here and just enter any email and password, you don't really need to remember it, all you want is the API key. After you sign-up, click on API Documentation and copy the API Key and save it. It will look something like this:
Code:
lx4afu7chmz75w65heuvaoncszwmhukf
*Note: ebookglue only allows you to use their API 25 times a month for free, so I only have my digest sent Monday - Friday as to not got over the limit. If you need a digest every day, after the 25th day, just go sign up for a new account and get a new API key.

Step 6: Set up your Google Drive to Download an epub file of your daily digest everyday at a certain time.

6.a:Make sure you're logged into the google account you are using to sync your kobo and then go to this link. Click on "Blank Project"

6.b: Copy and paste this code in:
Code:
function myFunction() {
var url = 'https://ebookglue.com/convert?token=YOUR-API-KEY&url=YOUR-URL';
var Blob = UrlFetchApp.fetch(url).getBlob();
var folder = DocsList.getFolder('Saved Articles');
var first = folder.createFile(Blob);
first.rename ('Daily Digest.epub');
}
Replace YOUR-API-KEY with the API key you got in step 5. Replace YOUR-URL with the URL you got in step 4.c. Make sure to include http://www. in front of the domain, even if it is a subdomain. For some reason, I could not get it to work with www. in front.

6.c: This script makes a file named Daily Digest.epub in a folder named Saved Articles. You can change those to whatever you want, just create the folder first in google drive. (These folders mean nothing to the kobo, but it helps keep everything organized I think)

6.d Name the script something and save it.

6.e Set up automatic triggers for this script so you get a daily digest. You can set this up however you want. I wanted mine to go off at the end of every workday.

To set up a trigger, click on the little clock that says "current project's triggers" when you hover over it. Then just set up the triggers the way you want. If you want a daily digest only on certain days like I do, then chose "Time-driven"|"Week timer"|"Every Monday"|"4pm to 5pm" - and then do that for every day of the week you want.

-Save the script again

6.f (optional) If you want to get really fancy, you can have a cover for your daily digest. I made something stupid for mine - http://imgur.com/PmCm4hA. You can do whatever you want for a cover, but to get it to be added in your ebook every day, all you have to do is add this to the end of the ebookglue url in your script:
Code:
&cover=URL-OF-COVER-IMAGE
So the whole thing, if you wanted a cover image, would look like this:
Code:
function myFunction() {
var url = 'https://ebookglue.com/convert?token=YOUR-API-KEY&url=YOUR-URL&cover=URL-OF-COVER-IMAGE';
var Blob = UrlFetchApp.fetch(url).getBlob();
var folder = DocsList.getFolder('Saved Articles');
var first = folder.createFile(Blob);
first.rename ('Daily Digest.epub');
}
That's it! Simple enough right?

Like I said, I wanted a piece of the Pocket on Kobo action, so I came up with a bit of a convoluted and tacky method of doing it, but it works!

Let me know if you have any questions, I'd love to help. Also, let me know if you have any suggestions if I missed something, or made it more difficult than it needs to be (I tend to do that).

Thanks!
Attached Files
File Type: zip rss.zip (2.2 KB, 400 views)
zacclay is offline   Reply With Quote
Old 09-06-2013, 02:53 PM   #2
KevinShort
Addict
KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.KevinShort ought to be getting tired of karma fortunes by now.
 
KevinShort's Avatar
 
Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
Pretty cool! I'm not sure that I'll be using this hack since my Glo should be getting Pocket integration pretty soon, but thanks for the detailed guide!
KevinShort is offline   Reply With Quote
Advert
Old 09-06-2013, 08:29 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Another way to do this is using calibre. This has a news download for Pocket that can produce an epub to be sideloaded.
davidfor is offline   Reply With Quote
Old 09-06-2013, 08:51 PM   #4
zacclay
Member
zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'zacclay knows the difference between 'who' and 'whom'
 
Posts: 13
Karma: 10202
Join Date: Aug 2013
Device: Kobo N647
Quote:
Originally Posted by davidfor View Post
Another way to do this is using calibre. This has a news download for Pocket that can produce an epub to be sideloaded.
Very true, and much easier. This was my way more complicated way to have it automated without me having to touch the computer or kobo haha.
zacclay is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe for Safari "Reading List" unread items anoved Recipes 6 03-19-2013 01:21 PM
Touch Kobo lost ALL my books' read/unread status jusmee Kobo Reader 10 12-15-2012 01:12 AM
Kobo Touch loses UNREAD/FINISHED status after disconnecting from Calibre DragonflyKing Library Management 4 03-15-2012 03:47 AM
How to not create a document/mobi, if there are no unread RSS items djg Recipes 0 01-17-2012 08:11 AM
Bug: Can't add items to the library and existin items corrupted ckole enTourage Archive 11 04-16-2010 01:13 AM


All times are GMT -4. The time now is 09:17 AM.


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