Scratching some itches of people who used and liked GReader

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:

Re: Scratching some itches of people who used and liked GRea

Postby fox » 15 Mar 2013, 22:30

set tag_cache to '', content_hash should be sha1() of content or something, you can set it to '' too.

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 15 Mar 2013, 22:37

Hi andrej,

what database is that - postgres? I only tested on MySQL so far and did not have that problem. I think the existence of default value should be independent of the OS. I did however use a database that was created roughly 1.5 years ago, maybe the schema for MySQL changed.

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

Re: Scratching some itches of people who used and liked GRea

Postby fox » 15 Mar 2013, 22:38

Unless you are using tt-rss from 1.5 years ago you should be using up to date schema.

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 15 Mar 2013, 22:40

Oh yeah, that's true, schema gets updated with new versions.

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

Re: Scratching some itches of people who used and liked GRea

Postby fox » 15 Mar 2013, 22:41

It could be that mysql is a bit more lax with things like default values, or there are some unexpected field default values there I didn't consider.

andrejg
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 15 Mar 2013, 21:22

Re: Scratching some itches of people who used and liked GRea

Postby andrejg » 15 Mar 2013, 22:44

nic wrote:what database is that - postgres?

no, its mysql 5.1.68.

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 15 Mar 2013, 22:45

Fox, I'd really love to make a plugin out of the greader import (and learn about the new plugin architecture), but I'll probably don't get around to it in due time (due to becoming father very recently). If anyone wants to help, I could make contributions, though. I just don't see myself doing this alone right now with all my other daily chores.

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

Re: Scratching some itches of people who used and liked GRea

Postby fox » 15 Mar 2013, 22:49

Gz on the father thing! I'm really terrible with python (last thing I did with it was some hyvebuild hacking and it was just ew) so I'm not really the one to help here.

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 15 Mar 2013, 22:53

Thanks! Well, I am not really a PHP expert, but I guess I could try to translate the python code to PHP.

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 15 Mar 2013, 23:08

andrejg wrote:
nic wrote:what database is that - postgres?

no, its mysql 5.1.68.


Not sure what to do about this. I guess then your DB must be configured different to mine. Weird.

You could adapt the script to insert NULL in these fields, to see if that works? Just a wild guess, though.

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

Re: Scratching some itches of people who used and liked GRea

Postby fox » 15 Mar 2013, 23:46

I'd go with '', some of those might be not null.

andrejg
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 15 Mar 2013, 21:22

Re: Scratching some itches of people who used and liked GRea

Postby andrejg » 16 Mar 2013, 00:04

yes, an empty string is working. at least until it comes across a duplicate entry and then breaks :). i'll probably just recreate the database to get rid of all the leftovers from experimentation :P.

anyway, here's the corrected sql inserts that work for me:

line 119 (added content_hash after content and '' after '{c}'):

Code: Select all

ttim.write("INSERT INTO ttrss_entries (guid, title, link, date_entered, date_updated, updated, content, content_hash) VALUES \
('{g}', '{t}', '{l}', '{pub}', '{pub}', '{pub}', '{c}', '');\n"\


line 127 (added label_cache, uuid, tag_cache before ref_id and '','','', before max(id)):

Code: Select all

ttim.write("INSERT INTO ttrss_user_entries (label_cache, uuid, tag_cache, ref_id, feed_id, owner_uid, published, marked,  note, unread) \
SELECT '', '', '', max(id), {fid}, {oid}, {pub}, {mar}, '{n}', 0 FROM ttrss_entries;\n\n"\
.format(fid=feed_id , oid=owner_uid, pub=int(shared), mar=int(not shared), n=s(note)))


edit:
Not sure what to do about this. I guess then your DB must be configured different to mine. Weird.

i have no idea. i've just downloaded ttrss yesterday, installed php and mysql on my windows server and followed the instructions.
i do have some odd behaviour though: if i log in as admin and then add a user i can't change the user role to power user or change the user's password. i can generate a new one, though and the user can log in and change her password...

nic
Bear Rating Trainee
Bear Rating Trainee
Posts: 40
Joined: 13 Nov 2011, 15:51

Re: Scratching some itches of people who used and liked GRea

Postby nic » 16 Mar 2013, 00:20


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

Re: Scratching some itches of people who used and liked GRea

Postby fox » 16 Mar 2013, 00:25

uuid should be set to '' on import, don't worry about it.

andrejg
Bear Rating Trainee
Bear Rating Trainee
Posts: 4
Joined: 15 Mar 2013, 21:22

Re: Scratching some itches of people who used and liked GRea

Postby andrejg » 16 Mar 2013, 01:08

nic wrote:Thanks, I added your suggestion: https://github.com/nhoening/gritttt-rss ... 2f5cf2a387

No, thank you for creating this script so that I don't have to :D. And thank you also, fox. You've made my transition from Google Reader practically painless :).

Another thing you might want to add is change the INSERT INTO to INSERT IGNORE INTO (so that it would ignore duplicates on insert). Apparently I have starred the same items multiple times, so the sql your script generates would break, since the GUID would be the same.
Either that or, to preserve the duplicated items, append something else to the URL you're inserting as GUID in instead of time():

Code: Select all

g='%s,imported:%f' % (s(link), time()),

Maybe gmtime()? I don't really know, I've never used Python before...


Return to “Support”

Who is online

Users browsing this forum: No registered users and 9 guests