Plugin to import Starred/Shared from Google Reader

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Plugin to import Starred/Shared from Google Reader

Postby fox » 28 Mar 2013, 16:51

This plugin will help you import your starred and shared data from Google Reader Takeout.

The plugin is bundled with 1.7.6 and newer, but there might be a few fixes in trunk on top of that, so it's recommended if
you used the following URLs to download the newest version, especially if importing fails for some reason.


1. Download the following two files (direct links):

https://raw.github.com/gothfox/Tiny-Tin ... rt/init.js
https://raw.github.com/gothfox/Tiny-Tin ... t/init.php

2. Place the files in plugins/googlereaderimport
3. Enable plugin in Preferences -> Plugins
4. Reload tt-rss
5. Go to Preferences -> Feeds -> Import starred/shared from Google Reader
6. Import your files - if the file is named starred.json, the contents will automatically starred, otherwise stuff will appear in archived feed

Meaningful data from JSON categories object will be automatically converted to tt-rss tags:

Code: Select all

   "categories" : [ "InDesign" ],


If your shared/starred.json is too huge and importer crashes with timeout, I've also added command line mode.

To use it, plugin should be added to config.php constant PLUGINS. Afterwards, you can run ./update.php --greader_import FILENAME.

FAQ
Q: Can I import my feeds with this?
A: Use opml-format XML file included in your Google Takeout .zip and feed it to OPML importer in Preferences -> Feeds.

Q: I can't upload/open files
A: This might be something with your PHP configuration. Your hosting provider can disable a lot of stuff in PHP, including file uploads. You can read this for more information: http://www.madirish.net/199

Q: Other file-related problems
A: If you are running update.php from the command line make sure you are actually using PHP command line interpreter, not CGI binary or anything else weird.

Dead giveaway for this would be HTTP headers being displayed:

Code: Select all

madoka:tt-rss% /usr/bin/php5-cgi ./update.php
X-Powered-By: PHP/5.3.3-7+squeeze14
Content-Language: auto
Content-Type: text/html; charset=


This is not supported and you shouldn't do that. If you don't know how to invoke PHP command line binary contact your hosting support.

Update: If you can't access PHP CLI interpreter and have to run the CGI binary as described above, but running importer complains about file not found, use this workaround (link or page 4 of this thread): viewtopic.php?f=21&t=1573&p=7853#p7849

Sometimes if your files are sufficiently large you might get a "file not found" or "file not uploaded" error because file size is limited by PHP, see this post:

viewtopic.php?f=21&t=1573&start=45#p8255

Q: The plugin sucks and doesn't work - are there alternatives?
A: Check this thread out for another importer: viewtopic.php?f=1&t=1087

ichbins4567
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 27 Mar 2013, 22:03

Re: Plugin to import Starred/Shared from Google Reader

Postby ichbins4567 » 28 Mar 2013, 18:31

Worked for me!

Code: Select all

All done. 62 out of 62 articles imported.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby fox » 28 Mar 2013, 18:40

Cool.

meddaugh
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 29 Mar 2013, 01:35

Re: Plugin to import Starred/Shared from Google Reader

Postby meddaugh » 29 Mar 2013, 01:37

I just downloaded the latest, my starred is 11mg (6522 items)....the import on the web did not work. I'm trying it command line:

./update.php --greader_import starred.json
X-Powered-By: PHP/5.3.10
Content-Language: auto
Content-Type: text/html; charset=

[21:35:53/32343] file not found:

$ ls -al starred.json
-rw-r--r-- 1 meddaugh meddaugh 11590867 Mar 28 17:27 starred.json


Also...how would I import this using multiple users for other users?

Thanks!

---Eric

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby fox » 29 Mar 2013, 08:45

Try using full path, e.g. /home/user/tt-rss/starred.json.

>Also...how would I import this using multiple users for other users?

It asks you for the username (which must exist).

Edit: also grab the latest plugin version from git, I think I fixed something regarding command line stuff.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Import shared/starred items from GReader: Postgres suppo

Postby fox » 29 Mar 2013, 14:08

Try the plugin stickied on top of Support forum.

meddaugh
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 29 Mar 2013, 01:35

Re: Plugin to import Starred/Shared from Google Reader

Postby meddaugh » 29 Mar 2013, 14:45

I was able to get it working, I had to edit the code and specify the full path to the file (I did try it on the command line), it kept saying "file not found: " and the file was blank. It did finally load in.

Something to add if you want, I was able to get it working is applying labels, like a google reader tag. I first had to create the label in Tiny RSS, then found the id # it assigned. I then downloaded the google tag .json version like this:

Code: Select all

https://www.google.com/reader/export/json/user/<USERIDNUMER>/label/<TAG>?likes=false&n=99999&full=true&co=false&hl=en   (it'll ask you to save it, and saves it as a .js file).


I had to change some code around to be able to apply the label correctly, but it did work, namely where it inserts the values into the ttrss_user_entries: (this example is tag/lable "transformer" and id 13).

Code: Select all

$tmp='[["13","transformer","",""]]';
                                db_query($this->link, "INSERT INTO ttrss_user_entries
                                        (ref_id, uuid, feed_id, orig_feed_id, owner_uid, marked, tag_cache, label_cache,
                                                last_read, note, unread, last_marked)
                                        VALUES
                                      ('$ref_id', '', NULL, NULL, $owner_uid, $marked, '', '$tmp', NOW(), '', false, NOW())");


It seems like there was some label stuff into it, but I think it was a bug prevented it from inserting in the DB(changed $link to $this->link, so I have to change things to this:

Code: Select all

$label="transformer";
//                              if (count($labels) != 0) {
//                                      foreach ($labels as $label) {
              label_add_article($this->link, $ref_id, trim($label), $owner_uid);
//                                      }
//                              }


I'm sure there is a more elegant way (like looking up the label id, or being passed the label). The only thing it didn't do was if the item was already imported on another label it would be nice to have it just add the label on to that existing one. I had one that didn't even load (9 items), as it was already applied to other labels and loaded. (You might know how to do that much quicker than me, but I might be able to get it as well)

It worked great overall. I did however have to increase the memory limit in my php.ini from 32M to 64M for the starred.json file as it was really big. Thanks so much for this!!! It was a big help to be able to Export my Tags I want to keep and then also import them as well.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby fox » 29 Mar 2013, 15:01

Labels are definitely doable, I just didn't bother with them so far.

Edit: I dunno about this tag thing, downloading stuff and whatnot sounds convoluted. JSON files contain category information:

Code: Select all

   [categories] => Array
        (
            [0] => user/09135264371301794412/state/com.google/read
            [1] => user/09135264371301794412/state/com.google/starred
            [2] => user/09135264371301794412/state/com.google/fresh
            [3] => Support
        )


First two are google stuff, but others may be converted into tt-rss tags or labels. I'm thinking tags.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby fox » 29 Mar 2013, 15:22

Well, with the latest plugin version, categories from json will be automatically converted to tt-rss tags.

mtavares
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 29 Mar 2013, 13:01
Location: Amsterdam, The Netherlands
Contact:

Re: Import shared/starred items from GReader: Postgres suppo

Postby mtavares » 29 Mar 2013, 15:45

Thx for the tip.
I tried with for stared items (had to increase the upload_max_filesize). For shared items I'm not even going to bother anymore - it's a 12Mb json and it looks like it has errors..
Fantastic how well tt-rss works hosted on a old eeepc. Feels faster than greader and the android app is trully great.

/me bows to fox (and to the rest of the people that have contributed to tt-rss).

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Import shared/starred items from GReader: Postgres suppo

Postby fox » 29 Mar 2013, 17:29

I'm not sure why the script uses link as a guid when there's a guid already available. Also, guid must be truncated to 255 unicode characters because mysql (which caused the error above).

Edit: not sure why the file invalid either, it doesn't decode or something? Looks okay to me. Try feeding it to the plugin.

mtavares
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 29 Mar 2013, 13:01
Location: Amsterdam, The Netherlands
Contact:

Re: Import shared/starred items from GReader: Postgres suppo

Postby mtavares » 30 Mar 2013, 01:22

The shared json has 18Mb.. it would take quite a while on the small eeepc I have hosting tt-rss (still faster than using greader, fantastic). I'll try it during this weekend to see if all goes well and provide feedback on any error.

I'm actually not sure if the file is shared.json file is invalid. I tries to paste the ofending entry into http://jsoneditoronline.org/ and it complained. Could be the entry that is wrong or it could be my copy&paste skills that leave much to be desired...

User avatar
sancho1234
Bear Rating Trainee
Bear Rating Trainee
Posts: 44
Joined: 30 Mar 2013, 04:19
Location: Hungary
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby sancho1234 » 30 Mar 2013, 14:15

I uploaded but the Preferences menu is crashed. What is the problem, what do you think?

The uploaded files in the folder:

Code: Select all

pi@raspberrypi /var/www/ttrss/plugins/googlereaderimport $ ls
init.js  init.php


After relogin to ttrss:

Image

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby fox » 30 Mar 2013, 14:19

Edit: ah right you downloaded html files or something, see the github cat logo. Download RAW files.

I have fixed the first post with direct raw links to files.

User avatar
sancho1234
Bear Rating Trainee
Bear Rating Trainee
Posts: 44
Joined: 30 Mar 2013, 04:19
Location: Hungary
Contact:

Re: Plugin to import Starred/Shared from Google Reader

Postby sancho1234 » 30 Mar 2013, 15:46

fox wrote:Edit: ah right you downloaded html files or something, see the github cat logo. Download RAW files.

I have fixed the first post with direct raw links to files.

Thank you! :)
Image


Return to “Support”

Who is online

Users browsing this forum: Google [Bot] and 2 guests