0

I'm am using LinqToTwitter in my application to gather tweets. For testing I now retrieve some public tweets and noticed text of tweets go missing:

Example:

Tweet in my application:
Tweet in my application
Original tweet:
Original tweet
Notice t.co/czD2e7Z3q1 in my application links to the original tweet and because the tweet text + t.co link would exeed the 140char limit the tweet text is shortend and ... is added.

Code

Currently I retrive tweets using this code:

var srch = (from search in twitterCtx.Search
                        where search.Type == Twitter.SearchType.Search &&
                            search.Query == "twitter" &&
                            search.Count == 100 &&
                            search.GeoCode == geocode &&
                            search.IncludeEntities == true
                        select search).SingleOrDefault();

Is there a way I can get the original tweet text without the t.co link at the end?

Community
  • 1
  • 1
Maiko Kingma
  • 929
  • 3
  • 14
  • 29

2 Answers2

2

I recently added extended tweet support to LINQ to Twitter. Here's the beta on NuGet: LINQ to Twitter v4.2.0 Beta 2.

Tip: You'll need to check the pre-release box in the VS NuGet GUI to find it.

Joe Mayo
  • 7,501
  • 7
  • 41
  • 60
  • I assume that I will need to wait for Twitter te release the extended tweet features shown on this page: https://dev.twitter.com/overview/api/upcoming-changes-to-tweets – Maiko Kingma Jan 24 '17 at 12:01
  • @MaikoKingma Most, if not all, of those changes are in effect now. In their Announcements section of the Forums, they talk more about what and when features are available: https://twittercommunity.com/c/announcements – Joe Mayo Jan 24 '17 at 19:02
  • @JoeMayo - I've installed v4.2.0 Beta 2 but I still get truncated tweets. Do I need to turn something else on? entity.FullText is also `null` – Greg Oct 12 '17 at 09:43
  • 1
    I think I found it - needed to set `TweetMode == TweetMode.Extended` – Greg Oct 12 '17 at 09:48
  • 1
    @JoeMayo does extended tweet support still display the original text (not the t.co shortened links)? I have TweetMode.Extended enabled and am still seeing t.co links in the FullText of the Status. – BLAZORLOVER Oct 17 '20 at 16:28
  • 1
    @BLAZORLOVER Check out the `Entities` property, it has a `UrlEntities` collection with all of the t.co links that map to the actual URL. There are also other entity types for hashtag, symbol, and user mentions. Another property, `ExtendedEntites`, has MediaEntities details too. – Joe Mayo Oct 17 '20 at 20:57
1

If you want it via the API, you will have to wait till the new changes outlined on dev.twitter are available.

Or, if you want an "ugly but works" solution today, you can just scrape twitter.com/<@user>/status/tweetid to get the full text of the tweet.

Soumitra
  • 99
  • 2