?

Log in

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

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

ItemID's [Jul. 22nd, 2002|01:36 am]
LiveJournal Client Discussions

lj_clients

[pyran]
Question:

The client that I'm writing stores an entry that the user posts locally. It stores all the necessary information for editing or retrieving a post later, including the ItemID. The ItemID is gained from the return value of the postevent.

Here's the question:
My last test post returned an itemid of 1338 (the one before returned 1337). However, those two posts are this and this. Neither of these have an id that matches the one returned by postevent. So is this a problem with the protocol? Or is this actually correct and talk*.bml uses a different ID from the postevent?

Thanks in advance. :-)
linkReply

Comments:
[User Picture]From: erebrandir
2002-07-22 07:35 am (UTC)
Multiply the itemid * 256, and add the anum, and you should get the itemid used in the talk system.
(Reply) (Thread)
[User Picture]From: pyran
2002-07-22 09:32 am (UTC)
Thanks! :-) Though I do have one more question: what's the anum?
(Reply) (Parent) (Thread)
[User Picture]From: youngoat
2002-07-22 11:40 am (UTC)

anums

It's not currently documented. =[

The way it works, itemids are sequential for your posts. But then the anum is randomly generated and used along with the real itemid to make the itemid you see in url's. This makes it so user's can't go, "Hey! I see post #254 and post #256. Why can't I see post #255?" or whatever...

So, get both the itemid and anum from the postevent response and then use the formula that erebrandir gave you.
(Reply) (Parent) (Thread)
[User Picture]From: pyran
2002-07-22 12:00 pm (UTC)

Re: anums

Perfect. I'm currently dumping the results of a postevent to the debug window, and I missed anum completely. Thanks! :-)
(Reply) (Parent) (Thread)
[User Picture]From: pyran
2002-07-22 05:45 pm (UTC)

Re: anums

Hmm... a thought just occurred to me: when editing a post or retrieving one, which itemid do I use? The one the postevent returned? Or the itemid*256*anum?
(Reply) (Parent) (Thread)
[User Picture]From: youngoat
2002-07-22 09:47 pm (UTC)

Re: anums

Just use the itemid that postevent returned. The anum is only used to create the itemid's used in url's as far as I know.

And the formula is actually url_itmid = (itemid*256) + anum =]
(Reply) (Parent) (Thread)