Programming fun
Jun. 6th, 2004 03:42 pmThis week's project was to get started on a program that would let me retrieve friends group information from the LJ servers and display it in the way that I want to (wait and see).
Having not doen any stuff with winsock in a couple of years (and nothing intensive then) and never having dealt with HTTP in the slightest, this was a bit of a challenge. However I've now got it posting the following (only with my password/username) and getting back a positive response.
Would have taken me far, far less time, only I started off trying to use Microsoft's Internet control, which theoretically would make things much simpler, unless of course you wanted to do things different to how Microsoft wanted you to.....
Now I've got stage 1 working I want to switch across to using encrypted passwords and then the XML interface. And _then_ wrap it all up in a nice DLL that I can give away to anyone that wants to do their own front end.
Having not doen any stuff with winsock in a couple of years (and nothing intensive then) and never having dealt with HTTP in the slightest, this was a bit of a challenge. However I've now got it posting the following (only with my password/username) and getting back a positive response.
POST /interface/flat HTTP/1.0
Host: www.livejournal.com
Content-type: application/x-www-form-urlencoded
Content-length: 34
mode=login&user=test&password=test
Would have taken me far, far less time, only I started off trying to use Microsoft's Internet control, which theoretically would make things much simpler, unless of course you wanted to do things different to how Microsoft wanted you to.....
Now I've got stage 1 working I want to switch across to using encrypted passwords and then the XML interface. And _then_ wrap it all up in a nice DLL that I can give away to anyone that wants to do their own front end.
no subject
Date: 2004-06-06 08:16 am (UTC)no subject
Date: 2004-06-06 02:41 pm (UTC)Sigh.
no subject
Date: 2004-06-06 04:00 pm (UTC)I thought you knew better!
Re: Programming fun
Date: 2004-06-07 02:18 am (UTC)Note that if you get up to the point where you are getting a session key to retrieve things like comments and such then after you have the session key, you have to send it back as a cookie to LJ in the HTTP request with the cookie contents being 'ljsession='.
Re: Programming fun
Date: 2004-06-07 10:09 am (UTC)And I'm doing it in VB because I plan to put together a DLL to do all the heavy lifting so that anyone wanting to do LJ front-end work in any language that can use COM has their life made much easier.
Re: Programming fun
Date: 2004-06-10 04:20 am (UTC)You can write actual DLLs in VB these days? I wrote a C DLL for VB back in VB 3 days but haven't kept up with it since then.
Re: Programming fun
Date: 2004-06-10 10:19 am (UTC)You simply create a class and set the project type to DLL - dead easy.