1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help automating logging into Twitter

Discussion in 'Social Networking Sites' started by BlackHatSoda, Sep 11, 2010.

  1. BlackHatSoda

    BlackHatSoda Junior Member

    Oct 6, 2009
    Likes Received:
    I'm trying to write a bot in .NET and running into issues logging into Twitter. I don't want to use the Twitter API but make it look like someone is logging in normally via their browser.

    I'm passing all the cookies in and all the form values. I've watched all the data going back and forth using Fiddler to make sure I'm getting all the form field values but I keep running into a 417 Expectation Failed error.

    Anyone know of a code example of how to programatically log into Twitter?
  2. bbrez1

    bbrez1 Power Member

    Feb 21, 2009
    Likes Received:
    Why would he buy it? If he has some programming knowledge he could make his own for free and while doing it learn new things.

    1. First load the twitter homepage (so the initial cookies get saved)
    2. Then:

    What you need to do is pass the values below via POST to https://twitter.com/sessions


    You will first need to parse the TOKEN from the website response using regex.
    Html code:

    <input type="hidden" value="41fc11b1fd0ba6c68f6d74de35e3b5cf13dad519" name="authenticity_token" id="authenticity_token">

    Did you do everything above?