Page 4 of 5

Re: Plugin to import Starred/Shared from Google Reader

Posted: 02 Apr 2013, 05:26
by wshealy
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

Re: Plugin to import Starred/Shared from Google Reader

Posted: 02 Apr 2013, 08:41
by fox
A few more quality posts like this and not reading first post will become a bannable offense.

Re: Plugin to import Starred/Shared from Google Reader

Posted: 02 Apr 2013, 11:35
by wshealy
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!

Re: Plugin to import Starred/Shared from Google Reader

Posted: 02 Apr 2013, 12:19
by sancho1234
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

Re: Plugin to import Starred/Shared from Google Reader

Posted: 02 Apr 2013, 12:46
by fox
I'll add the link to this solution to the FAQ for people who can't access PHP cli interpreter.

Re: Plugin to import Starred/Shared from Google Reader

Posted: 04 Apr 2013, 09:32
by ibreakcellphones
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"?

Re: Plugin to import Starred/Shared from Google Reader

Posted: 04 Apr 2013, 09:52
by fox
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.

Re: Plugin to import Starred/Shared from Google Reader

Posted: 04 Apr 2013, 10:22
by fox
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

Re: Plugin to import Starred/Shared from Google Reader

Posted: 04 Apr 2013, 18:15
by ibreakcellphones
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.

Re: Plugin to import Starred/Shared from Google Reader

Posted: 05 Apr 2013, 18:48
by jona2410
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

Re: Plugin to import Starred/Shared from Google Reader

Posted: 05 Apr 2013, 18:59
by fox
Well, it uses different structure for some reason (summary -> content instead of content).

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

Re: Plugin to import Starred/Shared from Google Reader

Posted: 05 Apr 2013, 19:09
by ibreakcellphones
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!

Re: Plugin to import Starred/Shared from Google Reader

Posted: 05 Apr 2013, 22:27
by justauser
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?

Re: Plugin to import Starred/Shared from Google Reader

Posted: 22 Apr 2013, 05:33
by Saliency
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.

Re: Plugin to import Starred/Shared from Google Reader

Posted: 01 Jul 2013, 08:07
by moomoochoo
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.