Six Apart Developer Center

Developer Center Home » Product Documentation » LiveJournal »

LJ.XMLRPC.syncitems

Posted by Byrne Reese on March 3, 2006

Returns a list (or part of a list) of all the items (journal entries, to-do items, comments) that have been created or updated on LiveJournal since you last downloaded them. Note that the items themselves are not returned --- only the item type and the item number. After you get this you have to go fetch the items using another protocol mode. For journal entries (type "L"), use the getevents mode with a selecttype of "syncitems".

Request Parameters

  • LiveJournal's Common Request Parameters
  • lastsync - The date you last downloaded synced, in "yyyy-mm-dd hh:mm:ss" format. Note: do not make this date up from the client's local computer... send the date from this mode's response of the newest item you have saved on disk. (optional)

Return Values

  • count - The number of items that are contained in this response (numbered started at 1). If synccount is equal to synctotal, then you can stop your sync after you complete fetching every item in this response.
  • total - The total number of items that have been updated since the time specified.
  • syncitems - An array of struct of type SyncItem

SyncItem Type

  • item - The nth item, in the form "Type-Number". Type can be one of "L" for log entries (journal entries), "C" for comments (not implemented), "T" for to-do items (not implemented), or many other things presumably. If your client doesn't know how to fetch an item of a certain type, just ignore them. A new version of your client could later see that it has never downloaded anything of type "T" and go back and fetch everything of that type from the beginning.
  • action - Either "create" or "update". This field isn't too useful, but you may want to make your client verbose and tell the user what it's doing. For example, "Downloading entry 5 of 17: Updated".
  • time - The server time (in the form "yyyy-mm-dd hh:mm:ss") that this creation or update took place. Remember in your local store the most recent for each item type ("L", "T", "C", etc...). This is what you send in subsequent requests in lastsync.

Sample Request

Sample Response

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.