?

Log in

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

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

Pagination [Jan. 24th, 2002|12:33 pm]
LiveJournal Client Discussions

lj_clients

[trippingbilly]
Using the mode getevents in the LiveJournal protocol, what methods can you use to page the results? You have the lastn selecttype request and the howmany request, but you don't have a beginat or anything similar. I was thinking of something like the LIMIT and OFFSET parameters of a SQL query ... a way to say "ok, select 20 entries beginning with the 40th entry". I need a way to paginate my results so users can scroll through the entries page by page.
linkReply

Comments:
[User Picture]From: xb95
2002-01-24 10:54 am (UTC)
The protocal already supports that with the lastsync parameter when selecttype == syncitems. What you have to do is send the request the first time with lastsync blank, it will return the first 300-500 items, then you pass it again to get the next one, et cetera. By doing this, you can then save the entries locally and allow the user to peruse at will.

If you don't like this setup, you can always fix it! :)
(Reply) (Thread)
[User Picture]From: trippingbilly
2002-01-25 01:04 am (UTC)

Right ...

Yeah, I know you can save them all locally. I implemented that yesterday and it worked. That's so sloppy though. Creating work for my server that LJ's server should be handling.

Also, I posted this in lj_dev because I didn't realize there was a client-specific community until just after. Notice the timestamps on the two posts and you'll notice the pause. :-)

Thanks for your reply!
(Reply) (Thread)