LibCurl to login (HTTP POST Forms)

I am trying to get my program to sign into twitter and then refresh the page and get the HTML for the users home page.

I have the program where it can download the HTML of the Twitter home, where your not signed in.

How do I get it to sign in?

I know it has to do with HTML forms.

Here is Twitters Form:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<form method="post" id="signin" action="https://twitter.com/sessions">
  
  <input id="authenticity_token" name="authenticity_token" type="hidden" value="08972a676acfc84bb7de0a161581c6c3bb4f38c4" />  <input id="return_to_ssl" name="return_to_ssl" type="hidden" value="false" />
  <p class="textbox">

    <label for="username">Username or email</label>
    <input type="text" id="username" name="session[username_or_email]" value="" title="username" tabindex="4"/>
  </p>

  <p class="textbox">
    <label for="password">Password</label>
    <input type="password" id="password" name="session[password]" value="" title="password" tabindex="5"/>
  </p>

  <p class="remember">
    <input type="submit" id="signin_submit" value="Sign in" tabindex="7"/>
    <input type="checkbox" id="remember" name="remember_me" value="1" tabindex="6"/>
    <label for="remember">Remember me</label>
  </p>

  <p class="forgot">
    <a href="/account/resend_password" id="resend_password_link">Forgot password?</a>

  </p>

  <p class="forgot-username">
    <a href="/account/resend_password" id="forgot_username_link" title="If you remember your password, try logging in with your email">Forgot username?</a>
  </p>
    <p class="complete">
      <a href="/account/complete" id="account_complete_link">Already using Twitter on your phone?</a>
    </p>

  <input type="hidden" name="q" id="signin_q" value=""/>
  </form>



-Twitter is an example, I want to learn how to do this so I can apply it to multiple sites
Anyone have any ideas? Tutorials?
Last edited on
Topic archived. No new replies allowed.