danielcrenna/tweetsharp — Issue #16: TwitterSearchStatus.Entities.Urls[].ExpandedValue returning null when executing TwitterService.SearchSince()
Author: mateuscb
Created: 2012-01-10 19:01:44+00:00
State: open

I´m using the latest version of Twittersharp from the Nuget Library (2.1.2). I have created a simple function to get the expanded URLs from tweets with links. Everything seems to work fine except for some reason the *ExpandedValue* is always null. I checked the raw output returned by the function and everything is fine.:

Tweets = service.SearchSince(lastTweet, search + " filter:links", 100);

if (Tweets.Statuses.Count() > 0)
{
foreach (var status in Tweets.Statuses)
{
foreach (var url in status.Entities.Urls)
{
var expanded = url.ExpandedValue;
}
}
}

After spending a bit debugging i was able to get it this working by commenting out **_entities = null.** Since I didn't quite understand the purpose of that line, I was afraid to comment the fix. I figured you would be able to understand it better.

//TwitterSearchStatus.cs:70
public virtual string Text
{
get { return _text; }
set
{
if (_text == value)
{
return;
}
_text = value;
// commented to fix ExpandedValue returning null
//_entities = null;
OnPropertyChanged("Text");
}
}

Finally, thanks for such a great tool! It has been most helpful!