I do use TUC for a usage tracking app I have at home (like to corroborate it will gargoyles reported usage) - with the the spark change that's broken. I know he'll fix it, but I'd like to remove my reliance on it, and deal with it myself.
Also have asked many times for an API, and basically told no.
So what I've worked out is there should be a request to:
With the post data of:
and what seems to be a new key of:
sign-in=Sign In (which encoded is Sign+In)
But whenever I get the response back it always seems to be back to the sign in page. And I can't see an error reported in the html/
So here's the code:
System.Net.WebRequest req = System.Net.WebRequest.Create(mURL);
req.Method = "POST";
byte send = System.Text.Encoding.Default.GetBytes("loginSrc=ext&username=<encoded email address>&password=<password>&sign-in=Sign+In");
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = send.Length;
req.Proxy = System.Net.WebRequest.DefaultWebProxy;
System.IO.Stream sout = req.GetRequestStream();
sout.Write(send, 0, send.Length);
System.Net.WebResponse res = req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(res.GetResponseStream());
lcHtml = sr.ReadToEnd();
Any help appreciated.