Plugin to import Starred/Shared from Google Reader

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
wshealy
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 31 Mar 2013, 20:08

Re: Plugin to import Starred/Shared from Google Reader

Postby wshealy » 02 Apr 2013, 05:26

I have not been able to import my starred.json with googlereaderimport get a backend.php file with error 7. It is a very larger file. I have tried both from feed preference and command line. The shared.json imported via the frontend without problem but it was 1/3 the size of starred.

(uiserver):~/ttrss > php6 ./update.php --greader_import starred.json
X-Powered-By: PHP/5.4.12
Content-Language: auto
Content-Type: text/html; charset=

[17:05:15/15473] file not found:

I have tried redoing Takeout.
Any help would be appreciated.
Wallace
Last edited by wshealy on 02 Apr 2013, 11:10, edited 1 time in total.

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 » 02 Apr 2013, 08:41

A few more quality posts like this and not reading first post will become a bannable offense.

wshealy
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 31 Mar 2013, 20:08

Re: Plugin to import Starred/Shared from Google Reader

Postby wshealy » 02 Apr 2013, 11:35

Well I clearly even when I read the first post didn't understand.
When I called my host support and asked about PHP command line interpreter they told me answering such questions was beyond their level of support. Since the only option I had was to run the cgi PHP headers and all, so I changed init.php in googlereaderimport to default to starred.json in the current directory and it ran like a charm.

I add these lines before the file not found check.

Code: Select all

if (!file_exists($file)) {
         $file = "./starred.json";
         }


And the result:

Code: Select all

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

[07:06:38/8118] please enter your username:
xxxx
[07:06:45/8118] looking up user: xxxx ...
[07:06:45/8118] processing: ./starred.json (owner_uid: 2)
[07:06:45/8118] will set articles as starred: true
[07:07:21/8118] All done. 1395 of 1410 articles imported.


Even though I had to deal with not having access to the PHP CLI my starred items are imported.
Now I'm happy.
Thanks for the Tiny Tiny RSS it is the greatest.
I appreciate all your work!

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 » 02 Apr 2013, 12:19

wshealy wrote:I add these lines before the file not found check.

Code: Select all

if (!file_exists($file)) {
         $file = "./starred.json";
         }



Yes, yes, yesss! :mrgreen: Your patch is working for me also! Thank you everybody!

Image

Edit:

The shared.json is working also:

Code: Select all

if (!file_exists($file)) {
         $file = "./shared.json";
         }


with

Code: Select all

./update.php --greader_import shared.json
Last edited by sancho1234 on 02 Apr 2013, 12:44, edited 1 time in total.

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 » 02 Apr 2013, 12:46

I'll add the link to this solution to the FAQ for people who can't access PHP cli interpreter.

ibreakcellphones
Bear Rating Trainee
Bear Rating Trainee
Posts: 31
Joined: 28 Mar 2013, 09:49

Re: Plugin to import Starred/Shared from Google Reader

Postby ibreakcellphones » 04 Apr 2013, 09:32

To fix the "File Not Found" or "File Not Uploaded" error, I had to check /etc/php/apache2/php.ini for the max_upload_filesize. It apparently defaults to 2M, which is on the small side for those of us who have been using Reader for a while.

I'm still getting a separate error when I try to load my newly generated starred.json:

Query 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 ('14963', '', NULL, , 2, true, '', '', NOW(), '', false, NOW()) failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 2, true, '', '', NOW(), '', false, NOW())' at line 5

My counting skills may be off, but this looks like orig_feed_id is marked with nothing, where perhaps it should be marked with ''?

I no speakee PHP, but is there a way you can get the length of $orig_feed_id in tt-rss/plugins/googlereaderimport/init.php before it's called in line 276 and if it's not been initialized, mark it with a couple single quotes instead? Or use "NULL"?

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 » 04 Apr 2013, 09:52

The feed should be auto created before that, at all times. Strange. Unfortunately without seeing the file I can't figure out why is it failing. If the file is too private and stuff, you can alternatively disable filing articles in feeds which should allow the import to complete.

In plugins/googlereaderimport/init.php at line 178 find "$create_archived_feeds = true;" and replace true with false.

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 » 04 Apr 2013, 10:22

Thanks to the files I received I found some missed checks for field lengths in the plugin, fixed those. Also added a fallback mechanism if feed wasn't created for the plugin.

https://github.com/gothfox/Tiny-Tiny-RS ... 8724f3b2ec

ibreakcellphones
Bear Rating Trainee
Bear Rating Trainee
Posts: 31
Joined: 28 Mar 2013, 09:49

Re: Plugin to import Starred/Shared from Google Reader

Postby ibreakcellphones » 04 Apr 2013, 18:15

Thanks. I'll have to get that fixed tonight (along with 1.7.8). Something about working for someone else to get money. And teenagers are just way too hungry.

jona2410
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 04 Apr 2013, 16:14

Re: Plugin to import Starred/Shared from Google Reader

Postby jona2410 » 05 Apr 2013, 18:48

Hi Fox,

I have a problem with google starred import and tumblr.

When I import starred items in tt-rss every thing is fine except for tumblr. :) But all tumblr importations are empty :(

In attachement, I put the extract of my google starred feed and the other file is the extract from the mysql database. As you can see, content field is empty in the database for this entry.

Can you please correct the plugin to import tumblr starred items please ? :)

Thanks
Jona
Attachments
starred_google.txt
starred google export extract
(928 Bytes) Downloaded 98 times
tiny_rss_entry.txt
sql entry
(486 Bytes) Downloaded 161 times

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 » 05 Apr 2013, 18:59

Well, it uses different structure for some reason (summary -> content instead of content).

Edit: fixed, https://github.com/gothfox/Tiny-Tiny-RS ... 18e1cb2fc2

ibreakcellphones
Bear Rating Trainee
Bear Rating Trainee
Posts: 31
Joined: 28 Mar 2013, 09:49

Re: Plugin to import Starred/Shared from Google Reader

Postby ibreakcellphones » 05 Apr 2013, 19:09

ibreakcellphones wrote:Thanks. I'll have to get that fixed tonight (along with 1.7.8). Something about working for someone else to get money. And teenagers are just way too hungry.

It's alive! It's...

Sorry, wrong meme.

Worked great! Thanks for the fixes!

justauser
Bear Rating Master
Bear Rating Master
Posts: 133
Joined: 23 Mar 2013, 20:37

Re: Plugin to import Starred/Shared from Google Reader

Postby justauser » 05 Apr 2013, 22:27

I've never been able to get this running. Tried again today (pulled master this AM), and it didn't work. However, this time I see the following in the web server error log:

Code: Select all



(mod_fastcgi.c.2701) FastCGI-stderr: PHP Warning:  preg_match(): Compilation failed: nothing to repeat at offset 0 in /home/tc/www/htdocs/ttrssgit/Tiny-Tiny-RSS/include/functions.php on line 3918
PHP Warning:  mysql_result(): Unable to jump to row 0 on MySQL result index 38 in /home/tc/www/htdocs/ttrssgit/Tiny-Tiny-RSS/include/db.php on line 98



Any ideas?

Saliency
Bear Rating Trainee
Bear Rating Trainee
Posts: 49
Joined: 27 Mar 2013, 20:05

Re: Plugin to import Starred/Shared from Google Reader

Postby Saliency » 22 Apr 2013, 05:33

FYI, I was able to use this script to import 3,740 articles. I had to add ]} to the end of the shared.json file google provided. After this it worked fine.

moomoochoo
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 01 Jul 2013, 07:49

Re: Plugin to import Starred/Shared from Google Reader

Postby moomoochoo » 01 Jul 2013, 08:07

I'm running wampserver. I had trouble with many of the methods listed here so in the end I opted for the repetitive method of creating several smaller versions of the starred.json file and importing them separately. I've included a little bit of info just in case people want to do it this way.

Here is the skeleton template I used (NOTE-you will need to change it - you will need to get this info from the beginning of your starred.json file)

Code: Select all

{
  "id" : "user/12345678901234567890/state/com.google/starred",
  "title" : "My starred items in Google Reader",
  "author" : "Me",
  "updated" : 13345637794,
  "direction" : "ltr",
  "items" : [
                   //insert copied data here-make sure you replace this comment
      ]
}


I then copied and pasted the repeated blocks of code

Code: Select all

{
    "isReadStateLocked" : true,
   // blah blah blah
  },
{
    "isReadStateLocked" : true,
   // blah blah blah
  }


within the code below in the skeleton template

Code: Select all

"items" : [
//insert copied data here-make sure you replace this comment
      ]


I could copy around 3000 lines per json file. I didn't test the upper limit.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 9 guests