Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have found that Twitter has 2 different PIN pages, and I think they determine which page to redirect you to depending on your browser.</p> <p>Something as simple as string parsing will work for you. The first PIN page I came across has the PIN code wrapped in a &lt;.code> tag, so simply look for &lt;.code> and parse it out: </p> <pre><code> if (innerHtml.Contains("&lt;code&gt;")) { pin = innerHtml.Substring(innerHtml.IndexOf("&lt;code&gt;") + 6, 7); } </code></pre> <p>The other page I came across (which looks like the one in the tutorial you are using) is wrapped using an id="oauth_pin" if I recall correctly. So, just parse that as well:</p> <pre><code>else if(innerHtml.Contains("oauth_pin")) { pin = innerHtml.Substring(innerHtml.IndexOf("oauth_pin") + 10, 7); } </code></pre> <p>innerHtml is a string that contains the body of the page. Which seems to be var htmlString = AuthenticationBrowser.SaveToString(); from your code.</p> <p>I use both of these in my C# program and they work great, full snippet:</p> <pre><code>private void WebBrowser1DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { var innerHtml = webBrowser1.Document.Body.InnerHtml.ToLower(); var code = string.Empty; if (innerHtml.Contains("&lt;code&gt;")) { code = innerHtml.Substring(innerHtml.IndexOf("&lt;code&gt;") + 6, 7); } else if(innerHtml.Contains("oauth_pin")) { code = innerHtml.Substring(innerHtml.IndexOf("oauth_pin") + 10, 7); } textBox1.Text = code; } </code></pre> <p>Let me know if you have any question and I hope this helps!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload