How to retrieve tweet text and creater hyperlink if text has an URL?

Nov 3, 2014 at 5:13 PM
The tweet Text returns plain text and it has no ability for the hyperlinks. How can I manipulate the tweet if it has a URL so it can be clicked and open up a new window?
Nov 3, 2014 at 5:37 PM

The ITweet interface has property called Entities and ExtendedEntities.
They both contains another property called URLs, which is a list of URLs detected by Twitter.

Each of these URLs contains additional information. One of which is called Indices. It is composed of 2 integers which represent the start and end of the URL within the Tweet message.

Please let me know if you need additional information.
Nov 3, 2014 at 5:48 PM
Thank you for your prompt response linvi.
In order to get the tweet text, I use Text property of Tweet object. How can I access Extended entities with the text and its urls with the hyperlinks?
Nov 4, 2014 at 12:40 AM
Hi again,

I am not sure how I can help you more than what I told you. Maybe some code will help?
var tweet = Tweet.PublishTweet("I think is awesome");
var URLsContainedInTweet = tweet.Entities.Urls;
var tweetinviCodeplexComURL = URLsContainedInTweet[0];
var startingPositionOfURLInTweet = tweetinviCodeplexComURL.Indices[0];
var endingPositionOfURLInTweet = tweetinviCodeplexComURL.Indices[1];
Nov 4, 2014 at 10:42 AM
Another way would be using regex to parse urls in the tweet text and replacing them with hyperlink html code. It should be fairly easy to parse urls as all urls in Tweet.Text would be urls.