using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System.Net; using System.IO; namespace SendMessageTOLJ { class SendIt { static void Main(string[] args) { while (true) { XDocument xd = new XDocument(); xd.Add(new XElement("methodCall", new XElement("methodName", "LJ.XMLRPC.sendmessage"), new XElement("params", new XElement("param", new XElement("value", new XElement("struct", new XElement("member", new XElement("name", "username"), new XElement("value", new XElement("string", "mcfnord"))), new XElement("member", new XElement("name", "password"), new XElement("value", new XElement("string", "mypass"))), new XElement("member", new XElement("name", "subject"), new XElement("value", new XElement("string", "whatever"))), new XElement("member", new XElement("name", "body"), new XElement("value", new XElement("string", "http://ljmindmap.com/"))), new XElement("member", new XElement("name", "to"), new XElement("value", new XElement("string", "brad"))))))))); ASCIIEncoding encoding = new ASCIIEncoding(); byte[] data = encoding.GetBytes("" + xd.ToString()); xd = null; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.livejournal.com/interface/xmlrpc"); request.UserAgent = "http://ljmindmap.com/; livejournal.mindmap.jrd@xoxy.net"; request.Method = "POST"; request.ContentType = "text/xml"; // "application/x-www-form-urlencoded"; request.ContentLength = data.GetLength(0); Stream newStream = request.GetRequestStream(); newStream.Write(data, 0, data.GetLength(0)); newStream.Close(); WebResponse response = null; response = request.GetResponse(); Stream s = response.GetResponseStream(); StreamReader sr = new StreamReader(s); string fd = sr.ReadToEnd(); Console.WriteLine(fd); System.Diagnostics.Debug.Assert(false == fd.Contains("ault")); } } } }
A C# LINQish RPC call to LJ
-
"Invalid password" when calling login method over XML-RPC
A week or two ago my LJBackup client started being unable to login - I didn't change anything (I think!), but now I always get an "Invalid password"…
-
cl-journal livejournal client
Hey everyone, I'd like to present a livejournal client that I wrote to fulfill my needs but maybe there are other people that can find it…
-
SessionGenerate and ljloggedin
Are there any information after release 86 and changes in cookies scheme to use sessiongenerate? It returns ljsession key, but this key is not enough…
- Post a new comment
- 0 comments
- Post a new comment
- 0 comments