Note that there are some explanatory texts on larger screens.

plurals
  1. POExtracting Twitter PIN info, WP7
    text
    copied!<p>I've been following this great tutorial: </p> <p><a href="http://buildmobile.com/twitter-in-a-windows-phone-7-app/#fbid=o0eLp-OipGa" rel="nofollow">http://buildmobile.com/twitter-in-a-windows-phone-7-app/#fbid=o0eLp-OipGa</a></p> <p>But it seems that the pin extraction method used in doesn't work for me or is out of date. I'm not an expert on html scrapping and was wondering if someone could help me find a solution to extracting the pin. The method used by the tutorial is:</p> <pre><code>private void BrowserNavigated(object sender, NavigationEventArgs e){ if (AuthenticationBrowser.Visibility == Visibility.Collapsed) { AuthenticationBrowser.Visibility = Visibility.Visible; } if (e.Uri.AbsoluteUri.ToLower().Replace("https://", "http://") == AuthorizeUrl) { var htmlString = AuthenticationBrowser.SaveToString(); var pinFinder = new Regex(@"&lt;DIV id=oauth_pin&gt;(?&lt;pin&gt;[A-Za-z0-9_]+)&lt;/DIV&gt;", RegexOptions.IgnoreCase); var match = pinFinder.Match(htmlString); if (match.Length &gt; 0) { var group = match.Groups["pin"]; if (group.Length &gt; 0) { pin = group.Captures[0].Value; if (!string.IsNullOrEmpty(pin)) { RetrieveAccessToken(); } } } if (string.IsNullOrEmpty(pin)){ Dispatcher.BeginInvoke(() =&gt; MessageBox.Show("Authorization denied by user")); } // Make sure pin is reset to null pin = null; AuthenticationBrowser.Visibility = Visibility.Collapsed; } </code></pre> <p>}</p> <p>When running through that code, "match" always ends up null and the pin is never found. Everything else in the tutorial works, but I have no idea how to manipulate this code to extract the pin due to the new structure of the page.</p> <p>I really appreciate the time,</p> <p>Mike</p>
 

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