private string ReplaceTextFromApi(string text, TwitterEntities entities)
{
if (entities != null)
{
if (entities.Urls != null)
{
foreach (var m in entities.Urls)
{
if (!string.IsNullOrEmpty(m.DisplayUrl)) text = text.Replace(m.Url, m.DisplayUrl);
}
}
if (entities.Media != null)
{
foreach (var m in entities.Media)
{
if (!string.IsNullOrEmpty(m.DisplayUrl)) text = text.Replace(m.Url, m.DisplayUrl);
}
}
}
return text;
}