?

Log in

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

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

widget for osx [May. 11th, 2005|12:03 am]
LiveJournal Client Discussions

lj_clients

[zloba]
Hello. I am writing a widget for osx to update a livejournal.

Currently it is using http://www.livejournal.com/interface/flat interface to post entries, get challenges and so on. After finishing and polishing the code, I've realized, that it is not able to post non-english letters. How can it be fixed? Is there any way to specify the encoding in flat interface?
linkReply

Comments:
[User Picture]From: int
2005-05-10 06:42 pm (UTC)
Can you encodeURIComponent() the text or something similar?
(Reply) (Thread)
[User Picture]From: zloba
2005-05-10 06:46 pm (UTC)
I can, but it produces garbarge. Livejournal gets it as a plaintext, still
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-10 07:20 pm (UTC)
Well that's how I do it... I use encodeURIComponent() on the post data, and make sure ver=1 is sent with the request, and it all works.
(Reply) (Parent) (Thread)
[User Picture]From: zloba
2005-05-10 08:56 pm (UTC)
what is ver=1?
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-10 10:51 pm (UTC)
Means that the client supports Unicode and LJ should recognise it.
(Reply) (Parent) (Thread)
[User Picture]From: zloba
2005-05-11 05:59 pm (UTC)
thanks, it helped me.
(Reply) (Parent) (Thread)
[User Picture]From: fus
2005-05-19 03:41 am (UTC)
thankyou for this piece of information, was grappling with a 'non-Unicode' client issue for over an hour, ready to pull my hair out when i saw this.
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-19 03:56 am (UTC)
I have a feeling everyone has this problem when initially writing their posting functions. :P
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 12:56 am (UTC)
I'm trying to get the right combination of ver and encodes to get my JavaScript based client posting links and formatting tags without the server the throwing a hissy fit at me.

At the moment I use encodeURIComponent() on my Subject, Music, Mood and Entry then add this ti the info posted via XMLRPC

'ver
[Error: Irreparable invalid markup ('<value<int>') in entry. Owner must fix manually. Raw contents below.]

I'm trying to get the right combination of ver and encodes to get my JavaScript based client posting links and formatting tags without the server the throwing a hissy fit at me.

At the moment I use encodeURIComponent() on my Subject, Music, Mood and Entry then add this ti the info posted via XMLRPC

'<member><name>ver</name><value<int>1</int></value></member>'

but the posts I make are filled with the converted characters, all the spaces are now "%" then "20" and so on.

Is there a missing link?
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 01:02 am (UTC)
d'oh, the I've missed out a right-angle-bracket in the post above, but it is there in my code
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-21 01:07 am (UTC)
Err, you're only meant to use that if you're posting via the flat interface. XMLRPC you shouldn't have to do anything, other than put text inside <![CDATA[]]> tags (or just escape tags, and don't forget you have to base64 encode the music string otherwise it'll die if you try to send unicode strings through it).
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 01:14 am (UTC)
I've just been posting like this

{member}{name}event{/name}{value}{string}'+entry+'{/string}{/value}{/member}

and at one point it did work, I was sending tags fine, but I guess I've disconnected the esccaping code I had in there. hmmm

I'll change that to be
{member}{name}event{/name}{value}{string}{![CDATA['+entry+']]}{/string}{/value}{/member}

and see how I go (with all the "{"s being angle brackets)



(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 01:33 am (UTC)
Worked as prescribed, you took a lot of debugging out of my day :-)
(Reply) (Parent) (Thread)
[User Picture]From: marksmith
2005-05-10 07:15 pm (UTC)
Are you using ver=1?
(Reply) (Thread)
[User Picture]From: zloba
2005-05-10 08:56 pm (UTC)
yes, flat interface it's called.
I am trying to move to xml-rpc interface, but there are some problems still.
(Reply) (Parent) (Thread)
[User Picture]From: xb95
2005-05-11 01:43 am (UTC)
Uh, ver has nothing to do with the flat interface or the XML-RPC interface. :P

ver relates to whether you're sending arbitrary 8-bit data or if you're sending Unicode data. If you want to send non-ASCII you need to set ver=1 and use Unicode.
(Reply) (Parent) (Thread)
[User Picture]From: zloba
2005-05-11 05:59 pm (UTC)
I've stopped my experiments with xml-rpc, ver helped me a lot :)
I was really pissed off with this, thanks.
(Reply) (Parent) (Thread)