Log in

No account? Create an account
Response to "postevent" - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

Response to "postevent" [Sep. 10th, 2006|07:53 pm]
LiveJournal Client Discussions
Hi all!

My client receives response to "postevent" flat-request:

anum = 203
itemid = 1
url = http://***.livejournal.com/459.html
success = OK

I wonder to know what does "anum" parameter stand for. And does "itemid" really useless, as said in documentation.

Thanks in advance :)

[User Picture]From: benzado
2006-09-10 05:08 pm (UTC)
As gaal said, (256 * anum + itemid) = the ID number of the post used on the site, in URLs and such. The anum is used so that somebody can't figure out how many hidden posts you are posting just by looking at the URLs.

The itemid is not useless, it is very useful, because if you are writing a client you can save it and use it in future requests to modify the entry you just posted. I hate that sentence in the documentation.
(Reply) (Thread)
From: ex_eugzol340
2006-09-10 05:12 pm (UTC)
And if I own an account how could I calculate itemid having link to some post?
(Reply) (Parent) (Thread)
[User Picture]From: benzado
2006-09-10 05:43 pm (UTC)
For the record, I had the equation wrong, it is (256 * itemid + anum) = webid.

If you know bit shifting, then (256 * itemid) is the same as (itemid << 8).

If you have the webid, you can just shift it eight bits to the right to get the itemid. In other words, itemid = (webid >> 8). You don't need the anum at all to convert in this direction.
(Reply) (Parent) (Thread)
From: ex_eugzol340
2006-09-10 10:24 pm (UTC)
OK, I understand, thank you =)
(Reply) (Parent) (Thread)