Archived Forum Post

Index of archived forum posts

Question:

problem login into livingsocial.com

Sep 03 '13 at 15:34

hello, everyone.

I'm writing a program in c# winform that automatically logs into livingsocial.com every hour and extracts new deals.

please see that below example code, I'm getting a 404 error code and the below response header. can someone please give me an working example. thank you.

Response Header:
Server: nginx
Date: Sat, 31 Aug 2013 17:34:15 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 728
Connection: keep-alive
Status: 404 Not Found
X-Request-Id: 5c7f8ed2c18b4ba78ba3fbb88e009add
X-Runtime: 0.003467
X-Rack-Cache: invalidate, pass

        Chilkat.Http http = new Chilkat.Http();
        bool unlocked = http.UnlockComponent("Any string begins 30-day trial");
        if (!unlocked)
        {
            MessageBox.Show("Failed to unlock HTTP component");
            return;
        }

        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
        req.UsePost();
        req.Path = "/accounts/authenticate";
        req.AddParam("callback_url", "https://login.livingsocial.com/login_callback");
        req.AddParam("email", "someuser@hotmail.com");
        req.AddParam("password", "password");
        req.AddParam("remember_me", "true");

        bool ssl = true;   // Set this to true to use HTTPS
        Chilkat.HttpResponse resp = http.SynchronousRequest("login.livingsocial.com", 443, ssl, req);
        if (resp == null)
        {
            richTextBox1.Text = http.LastErrorText;
            return;
        }

        // Did we get a successful response?
        if (resp.StatusCode == 200)
        {
            // Display the HTML source we received.
            richTextBox1.Text = resp.BodyStr;
        }
        else
        {
            // Show the full response header...
            richTextBox1.Text = resp.Header;
        }

Answer

See this Chilkat blog post: Automating a Website Login using Chilkat HTTP


Answer

thank you, for that information. I've used a plugin called HttpFox for firefox and monitored the HTTP traffic between the browser and the web servers. I found it was posting to accounts.livingsocial.com not login.livingsocial.com, thanks chilkat know is working.