tonybaldwin: tony baldwin (tony baldwin)tonybaldwin ([personal profile] tonybaldwin) wrote,
@ 2010-04-06 10:46 am UTC
Current location:127.0.0.1
Current mood:focused
Current music:none
Entry tags:dreamwidth, insanejournal, livejournal, wordpress, xmlrpc, xpostulate
Okay...I've started to hack up the xmlrpc functions.
First, I had to replace all "<" and ">" in html tags in a post with"&lt;" and "&gt;",
and then, I have basically just handwritten out a relevant xml file.
Which looks like this:

<?xml version="1.0"?><methodCall><methodName>LJ.XMLRPC.postevent</methodName><params><param><value><struct><member><name>username</name><value><string>tonytraductor</string></value></member><member><name>password</name><value><string>XXXXXXXX</string></value></member><member><name>subject</name><value><string>xmlrpc posting</string></value></member><member><name>lineendings</name><value><string>pc</string><value></member><member><name>year</name><value><int>2010</int></value></member><member><name>mon</name><value><int>04</int></value></member><member><name>day</name><value><int>06</int></value></member><member><name>hour</name><value><int>10</int></value></member><member><name>min</name><value><int>46</int></value></member><member><name>prop_current_location</name><value><string>127.0.0.1</string></value></member><member><name>propr_current_mood</name><value><string>focused</string></value></member><member><name>prop_taglist</name><value><string>xmlrpc, xpostulate, wordpress, livejournal, dreamwidth, insanejournal</string></value></member><member><name>prop_currentmusic</name><value><string>none</string></value></member><member><name>userjournal</name><value><string>which journal?</string></value></member><member><name>event</name><value><string>Okay...I've started to hack up the xmlrpc functions.
First, I had to replace all "<" and ">" in html tags in a post with "&lt;" and "&gt;",
and then, I have basically just handwritten out a relevant xml file.


</string></value></member></struct></value></param></params></methodCall>


What I haven't done is tried to send such a file to a server, yet...
I'm not sure if the posting method has to be different from a flat post, in terms of simply sending this file as the post data...
More work...
But, hey, I'm working on it!


(Read 50 comments) - (Post a new comment)
(Flat) (Top-level comments only)

tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 03:28 pm UTC (link)
wait...
does $getchal actually need something in the params/param/value/struct?
Because, I just copied from your post http://catness.dreamwidth.org/61674.html
Do I need to include username/password or something in that struct?
let me try that...maybe I'll get a valid response.
Although, I think I'm just feeding tdom the wrong thing...not sure.

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 03:30 pm UTC (link)
nope...still keep getting an error from the parser
syntax error on line 1 col 0

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 03:30 pm UTC (link)
I'm up on #tcl @freenode trying to sort this out

(Reply to this)  (Thread from start)  (Parent


catness: (fire_eye)

Re: curioser and curioser


[personal profile] catness
2010-04-07 04:16 pm UTC (link)
No, getchallenge does NOT need username/password (that's why it's secure ;) You can see exactly what it needs:
http://www.livejournal.com/doc/server/ljp.csp.xml-rpc.getchallenge.html

re:base64, cyrillic characters certainly require encoding, not sure about European languages, I think German characters worked without it...

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 04:24 pm UTC (link)
well then, if ß works, ç should be fine.

Content-Length: 97
this should basically be static, right?
I don't need to fish that var out of anywhere, since, it appears the very same text/xml is sent for every challenge.

(Reply to this)  (Thread from start)  (Parent


catness: (fire_eye)

Re: curioser and curioser


[personal profile] catness
2010-04-07 04:19 pm UTC (link)
Can you print out the full response from the server (before parsing it)?

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 04:28 pm UTC (link)
AHA!
I get this:

Date {Wed, 07 Apr 2010 16:26:57 GMT} Server Apache Set-Cookie {ljuniq=ZodqxpGlhZ3WN4C:1270657617:pgstats0:m0; expires=Sunday, 06-Jun-2010 16:26:57 GMT; domain=.livejournal.com; path=/} Content-Length 510 Content-Type text/xml SOAPServer SOAP::Lite/Perl/0.60 Connection close


is ljuniq= the value I need?

I was expecting an xml response

(Reply to this)  (Thread from start)  (Parent)  (Thread


catness: (fire_eye)

Re: curioser and curioser


[personal profile] catness
2010-04-07 04:29 pm UTC (link)
No, it's a cookie. You need a xml response, just like in the documentation. Yes, content length can be static.

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 04:35 pm UTC (link)
But I didn't ask for a cookie, darn it!
I'll continue trying to sort this out later...
gotta get ready to take my nephew to NY City to see Opeth (death metal from Sweden, or something...fun fun!)

(Reply to this)  (Thread from start)  (Parent)  (Thread


tonybaldwin: tony baldwin (tony baldwin)

Re: curioser and curioser


[personal profile] tonybaldwin
2010-04-07 04:36 pm UTC (link)
My nephew is a real hacker, but he hates xml and doesn't write tcl.
I gave him is first Linux (suse) about 7 years ago.
You probably knew that...I beam and brag about the kid all over the place.

(Reply to this)  (Thread from start)  (Parent


catness: (fire_eye)

Re: curioser and curioser


[personal profile] catness
2010-04-07 04:50 pm UTC (link)
ok, here's how you print the response from the server.

set url "http://www.livejournal.com/interface/xmlrpc"
set getchallenge [http::geturl $url -query $getchal -type "text/xml" ]
puts [http::data $getchallenge]

Yay death metal! :D

(Reply to this)  (Thread from start)  (Parent



(Read 50 comments) - (Post a new comment)
(Flat) (Top-level comments only)