tonytraductor (tonytraductor) wrote in lj_dev,


I would like to add lj posting capability to Tickle Text, a text editor I wrote in tcl/tk, but, being entirely new to trying to work with this particular kind of thing (communicating with a remote machine, but not using ftp or ssh) I'm a little lost.
Maybe someone here can straighten me out...or point me to resources that explain the matter a bit more clearly.
I'm using what I found here (Part III. Client/Server Protocol) and here (Tcl socket manual page).

This is the proc I've written, as a test, and it doesn't seem to be getting any response, or, effectively posting to my journal.
This is the most basic attempt just to understand how to use
a) socket
b) the protocol to communicate with the LJ server.

proc ljpost {} {
set chan [socket 80]
puts $chan "POST /interface/flat HTTP/1.1\n
Content-type: application/x-www-form-urlencoded\n
Content-length: 105\n

close $chan


I don't even understand, at this juncture, how to get/read a response from the server.
The only things I've written that have had to communicate with a remote machine have used ssh or ftp,
so, this is completely unfamiliar territory to me.
I don't know, here, if I am misunderstanding how to use tcl socket, or the protocol to communicate with the server.
I know I'm doing something wrong, because this fails to post to my journal (yes, I replace ****** with my actual password).
Tags: client, client: posting, code: tcl/tk

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded