||[Jan. 24th, 2002|12:33 pm]
LiveJournal Client Discussions
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.|
2002-01-24 10:54 am (UTC)
The protocal already supports that with the
selecttype == syncitems
. What you have to do is send the request the first time with
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
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!