?

Log in

No account? Create an account
Client Help - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Client Help [Mar. 9th, 2002|03:22 pm]
LiveJournal Client Discussions

lj_clients

[halkeye]
Trying to figure out how to retrieve/backup all entries.
I know syncitems will return all the events updated using sync_total. But can someone suggest a good way/algorithm to make sure i have all the entries?
linkReply

Comments:
From: evan
2002-03-09 03:47 pm (UTC)
syncitems doesn't work anymore (clustering broke it).

I have some code that used to work at http://neugierig.org/software/livejournal/python/sync that should show the algorithm I used. I had to do some weird hack-y things to make it work, though...
(Reply) (Thread)
[User Picture]From: halkeye
2002-03-09 03:54 pm (UTC)
Thats fine, this server is not clustered, so no problem. (initially designed for non lj.com, but will be when fixed)

and from what i see (quickly, and i think some files are missing) it just stores the last time retrieved, and rerequest more entries?
and it probably does or should check to see if sync_total == sync_count...

Right?

(and it looked like to me sync items works *shrug*)
(Reply) (Parent) (Thread)
From: evan
2002-03-09 05:35 pm (UTC)
Yeah, I think you got it. I must admit I haven't looked at that code in a while.

I think it's like this:

do {
set the "lastsync" field in your request to the synctime of the last item you received
make the request
save all of these sync items, making sure to not save duplicates twice
} while (total items received < totalcount that lj gave you)
(Reply) (Parent) (Thread)
[User Picture]From: youngoat
2002-03-09 06:01 pm (UTC)

ljsync

ljsync (a perl syncitems client) might be helpful... It's commented pretty well. It looks like you're right. You just keep going until sync_count == sync_total.

And I'm pretty sure syncitems still works, even with clusters.
(Reply) (Thread)