title: Twitter Login via Jsoup Java Android
body: <p>I'm trying to login to twitter using Jsoup because I want to scrape my tweets and send them to me via SMS, I know how to process them from HTML and I know how to send them via SMS, I need help in Log In step, I'm not able to login to twitter
  what I've tried is, processing webview in background(without any ui)(Note: No Ui of the app) but failed because it can't be processed without UI, with Jsoup I tried to login using this code</p>
  
  <pre><code>final String usernameKey = "session[username_or_email]";
  final String passwordKey = "session[password]";
  final String loginFormUrl= "https://mobile.twitter.com/login";
  final String loginActionUrl = "https://mobile.twitter.com/sessions";
  
  HashMap&lt;String, String&gt; cookies = new HashMap&lt;&gt;();  
  HashMap&lt;String, String&gt; formData = new HashMap&lt;&gt;();  
  
  Connection.Response loginForm = Jsoup.connect(loginFormUrl)
                      .userAgent(userAgent)
                      .method(Connection.Method.GET)
                      .execute();
  
  cookies.putAll(loginForm.cookies());
  
  doc = Jsoup.connect(loginActionUrl)
      .data(usernameKey, username)
      .data(passwordKey, password)
      .cookies(cookies)
      .method(Connection.Method.POST)
      .userAgent(userAgent)
      .post();
  
                  /*
                   doc = Jsoup.connect(twitterHomePage)
                   .userAgent(userAgent)
                   .cookies(loggedIn.cookies())
                   .timeout(30 * 1000)
                   .get();
                   */
  Log.d(TAG, doc.html());
  </code></pre>
  
  <p>But I'm not logged in and only getting Twitter Login page HTML</p>