Quick Overview
- Tweet Extended Entities
- Proxy
- Timeout and Improved reliability
- Advanced Search
- Twitter Accessor
- Settings
- Rate Limits
- Block
- Other Updates
- Tweetinvi 0.9.4.1
Tweet Extended Entities
Few months ago, Twitter added a field they called Extended Entities in the Tweet objects.Extended Entities contains the same information as Entities but I would recommend to use these as Twitter will only support multiple entities (like images) in the Extended version.
var tweet = Tweet.GetTweet(24948294); var extendedEntities = tweet.ExtendedEntities;
Proxy
It is now possible to use proxies. These will make some developers quite happy and potentially help some to bypass limitations enforced by Twitter.
TweetinviConfig.CURRENT_PROXY_URL = "http://198.232.247.23:4829";
Timeout and Improved reliability
Some of you might have noticed that Twitter got some issues with their API recently. Some WebRequest never completed and some returned invalid responses. Tweetinvi is now handling error from Twitter in a better way.This version give you the ability to specify a Timeout duration before a request is considered as cancelled.
TweetinviConfig.CURRENT_WEB_REQUEST_TIMEOUT = 5000;
Advanced Search
Search Metadata
Search now includes a new method called SearchTweetsWithMetadata. This method returns anISearchResult containing both the standard Search result and the details for each of the query performed by Tweetinvi. Therefore you will be able to access the metadata returned by each of the search performed by Tweetinvi.// Get all the tweets from a search with metadatavar searchResult = Search.SearchTweetsWithMetadata("tweetinvi"); var tweets = searchResult.Tweets; // Get the searches info for each of the search queries performedvar searchQueryResults = searchResult.SearchQueryResults; // Analyse a single search resultvar searchResult = searchQueryResults.First(); var searchQueryMetadata = searchResult.SearchMetadata; // Get all the tweets returned by Twittervar allTweetsReceivedFromTwitter = searchResult.AllTweetsFromQuery; // Tweetinvi filters the Twitter results based on the TweetSearchFilter of a Search Queryvar tweetsFilterByTweetinvi = searchResult.FilteredTweets;
Tweet Metadata
The tweets returned by SearchTweetsWithMetadata will also contain additional information and implement the newITweetWithSearchMetadata interface which contains both the ResultType and ISOLanguageCode.var searchResults = Search.SearchTweetsWithMetadata("linvi"); var tweet = searchResults.Tweets.First(); var tweetMetadata = tweet.SearchMetadata;
Twitter Accessor
The Twitter Accessor is a tool that you can use to execute custom queries. You have now access to 2 new features.// ExecuteGETQueryFromPath (or POST) allow you to extract objects from a specific path of the json response from Twitter// EXAMPLE : JSON = '{ "statuses" : { MULTIPLE_TWEETS}, "plop" : { ... } }'. The following query extract all the tweets included in the statuses json pathvar tweetDTOs = TwitterAccessor.ExecuteGETQueryFromPath<IEnumerable<ITweetDTO>>("https://api.twitter.com/1.1/search/tweets.json?q=tweetinvi", "statuses"); // ExecuteCursorGETQuery returns a list of objects directly from a cursor query - no need to iterate over the different query resultsvar userDTOs = TwitterAccessor.ExecuteCursorGETQuery<IUserDTO, IUserCursorQueryResultDTO>(cursorQuery);
Settings
In addition to adding new configuration settings, you will now be able to define different settings for each of the thread Tweetinvi is used.Each time a new thread is created the TweetinviConfig.ApplicationSettings are copied to the new thread settings accessible from TweetinviConfig.CurrentSettings.
// Change Current Thread Settings TweetinviConfig.CURRENT_SHOW_DEBUG = false; // Change Application Settings TweetinviConfig.APPLICATION_SHOW_DEBUG = false;
Rate Limits
Newly created rate limits like StatusesLookup have been added to Tweetinvi (see all new rate limits).Block Features
Block allows you to block users from a LoggedUser or from the currently logged in account. All the features provided by Twitter are now available from Tweetinvi.Other Updates
- It is now possible to get multiple Tweets in a single call Tweet.GetTweets()
- An error will now be thrown when the credentials have not been set and a user tries to perform an action.
Bug Fixes
- Improved algorithm for Tweet Length
- Credentials Creator are now working correctly
- GetUserFromNames now works correctly
Tweetinvi 0.9.4.1
- Fixed bug that resulted in Credentials to be reset.- Fixed bug in Search
- Added CashTags support for FilteredStream