So I was caught flat footed by the Twitter api Version1 retirement. And now I'm not sure how to move my apps from reading the old RSS/XML twitter feed to the new Json ( no experience with Json yet). Can someone help ? Here is the current code, that I need to change over to read the Twitter Json.
void TwitterStatusInformationCompleted(object sender, DownloadStringCompletedEventArgs e)
{
LoadEventArgs loadedEventArgs = new LoadEventArgs();
try
{
var doc = Newtonsoft.Json.(e.Result);
foreach (var item in doc.Descendants("status"))
{
var model = new TwitterStatusModel()
{
Date = item.Element("created_at").Value.Substring(0, item.Element("created_at").Value.IndexOf('+')),
Text = item.Element("text").Value,
};
TwitterFeed.Add(model);
}
loadedEventArgs.IsLoaded = true;
loadedEventArgs.Message = "";
}
catch (Exception)
{
loadedEventArgs.IsLoaded = false;
loadedEventArgs.Message = "unable to load twitter data";
}
finally
{
OnTwitterLoaded(loadedEventArgs);
}
TwitterFeed = null;
}
Thanks for any help.