Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Updated Release: Tweetinvi 0.9.6.x

$
0
0
Visit Tweetinvi 0.9.6.x Work Items

Custom Parameters

When an action can be performed with a 'RequestParameters' class (e.g. Search, Timeline, Message...), you will now be able to specify CustomQueryParameters.

The goal of such a feature is to give the ability to developers to quickly add new parameters to existing Endpoints. This is required so that they do not have to wait for the next release of Tweetinvi to use such parameters.

var searchParameters = Search.CreateTweetSearchParameter("hello");
searchParameters.AddCustomQueryParameter("include_entities", "false");

RateLimit Tracker

You will now be able to track the RateLimits but handle them yourself. A third option called TrackOnly will no longer await for the RateLimits to be available but will still continue to keep track of the RateLimits within the application.

// The previous code 
RateLimit.UseRateLimitAwaiter = true;

// Has now been changed into
RateLimit.RateLimitTrackerOption = RateLimitTrackerOptions.TrackAndAwait;

// The new feature is now available with the TrackOnly option
RateLimit.RateLimitTrackerOption = RateLimitTrackerOptions.TrackOnly;

Search Filters

This new release introduces the Search Filters (Images, Videos, Hashtags, Links, News, Replies, Verified).

A previous property called TweetSearchFilters has been renamed to TweetSearchType. This property allows to specify which type of Tweet we want to receive from the Search.

The Filters property just filter the content based on its type or its content.

// This code will return the tweets in relation with manga but all this tweet will contain a video.var searchParameter = Search.CreateTweetSearchParameter("manga");

// Add some filters to the query
searchParameter.Filters = TweetSearchFilters.Videos;

// Specify which mode of search we want to use
searchParameter.SearchType = SearchResultType.Popular;

// Specify which type of tweets needs to be retrieved
searchParameter.TweetSearchType = TweetSearchType.OriginalTweetsOnly;

Entities Update & Video

Tweet Entities have been modified "significantly". The previous property ExtendedEntities has been removed.

Instead, the Entities property will now return the ExtendedEntities. If the ExtendedEntities are not available in the json, the Entities property will return the LegacyEntities.

In addition Tweetinvi now supports the Video entities.

var tweet = Tweet.GetTweet(tweetWithVideoId);
var media = tweet.Entities.Medias[0];
if (media.MediaType == "video")
{
    var duration = media.VideoDetails.DurationInMilliseconds;
}

Stream - Multiple languages support

Tweetinvi now supports multiple languages with a new set of methods.

var stream = Stream.CreateSampleStream();

// Add multiple languages
stream.AddTweetLanguageFilter(Language.French);
stream.AddTweetLanguageFilter(Language.English);
stream.AddTweetLanguageFilter(Language.Spanish);

// Remove a language from the list
stream.RemoveTweetLanguageFilter(Language.Spanish);

// Access the languages set for the streamvar filteredLanguages = stream.FilteredLanguages;

// Remove all languages filters to get everything
stream.ClearTweetLanguageFilters();

Report User For Spam

It is now possible to report a user for spam.

User.ReportUserForSpam(23829382);

Tweetinvi Events

The events have been reordered so that the AfterQueryExecute is now invoked after the RateLimit has been updated if the TrackOnly or TrackAndAwait option has been selected for the RateLimitTracker.

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>