Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

hannesbarbez/BarbezDotEu.Twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BarbezDotEu.Twitter

An unofficial, modern, very much work-in-progress client for Twitter APIs.

Contents

ITwitterDataProvider type

Namespace

BarbezDotEu.Twitter.Interfaces

Summary

Defines a blueprint for a data provider that connects to and can call Twitter.com APIs.

Configure(twitterConfiguration) method

Summary

Configures this ITwitterDataProvider so that it can successfully communicate with the Twitter.com APIs.

Parameters
Name Type Description
twitterConfiguration BarbezDotEu.Twitter.TwitterConfiguration The TwitterConfiguration to configure this ITwitterDataProvider with.
Remarks

Configuration is required before any APIs can be called.

GetRecentTweets(topic) method

Summary

Queries for occurences of the given topic found in tweets from the past 7 days.

Returns

A list of MicroBlogEntry items corresponding to the given topic.

Parameters
Name Type Description
topic System.String The topic for which to query.

Tweet type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the Tweet DTO as defined by the third-party provider.

Attachements property

Summary

Gets or sets the attachements.

AuthorId property

Summary

Gets or sets the author ID.

ContextAnnotations property

Summary

Gets or sets the context annotations.

ConversationId property

Summary

Gets or sets the conversation ID.

CreatedAt property

Summary

Gets or sets the time when the tweet was created,

Id property

Summary

Gets or sets the ID.

Language property

Summary

Gets or sets the language.

PossiblySensitive property

Summary

Gets or sets whether the tweet is possibly sensitive.

PublicMetrics property

Summary

Gets or sets the public metrics.

ReplySettings property

Summary

Gets or sets the reply settings.

Source property

Summary

Gets or sets the source.

Text property

Summary

Gets or sets the text.

TweetEntities property

Summary

Gets or sets the entities.

TweetAnnotationEntity type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetAnnotationEntity DTO as defined by the third-party provider.

NormalizedText property

Summary

Gets or sets the normalized text.

Probability property

Summary

Gets or sets the probability.

Type property

Summary

Gets or sets the type.

TweetAttachements type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TweetAttachements DTO as defined by the third-party provider.

MediaKeys property

Summary

Gets or sets the media keys.

GetMediaKeysAsCsv() method

Summary

Gets the MediaKeys in CSV format.

Returns

The MediaKeys in CSV format.

Parameters

This method has no parameters.

TweetBaseEntity type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetBaseEntity DTO as defined by the third-party provider.

End property

Summary

Gets or set the index of the last character of the entity in the tweet.

Start property

Summary

Gets or set the index of the first character of the entity in the tweet.

TweetContextAnnotation type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TweetContextAnnotation DTO as defined by the third-party provider.

Domain property

Summary

Gets or sets the domain.

Entity property

Summary

Gets or sets the entity.

TweetEntities type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetEntities DTO as defined by the third-party provider.

Annotations property

Summary

Gets or sets the annotations.

CashTags property

Summary

Gets or sets the cashtags.

HashTags property

Summary

Gets or sets the hashtags.

Mentions property

Summary

Gets or sets the mentions.

Urls property

Summary

Gets or sets the URLs.

GetCashTagsAsCsv() method

Summary

Returns any CashTags in CSV format.

Returns

The CashTags in CSV format.

Parameters

This method has no parameters.

GetHashTagsAsCsv() method

Summary

Returns any HashTags in CSV format.

Returns

The HashTags in CSV format.

Parameters

This method has no parameters.

GetMentionsAsCsv() method

Summary

Returns any Mentions in CSV format.

Returns

The Mentions in CSV format.

Parameters

This method has no parameters.

TweetKeyOrValue type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TweetKeyOrValue DTO as defined by the third-party provider.

Description property

Summary

Gets or sets the description.

Id property

Summary

Gets or sets the ID.

Name property

Summary

Gets or sets the name.

TweetMentionEntity type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetMentionEntity DTO as defined by the third-party provider.

Username property

Summary

Gets or sets the user name.

TweetMetrics type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TweetMetrics DTO as defined by the third-party provider.

LikeCount property

Summary

Gets or sets the number of likes.

QuoteCount property

Summary

Gets or sets the number of quotes.

ReplyCount property

Summary

Gets or sets the number of replies.

RetweetCount property

Summary

Gets or sets the number of retweets.

TweetTagEntity type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetTagEntity DTO as defined by the third-party provider.

Tag property

Summary

Gets or sets the hash- or cashtag.

TweetUrlEntity type

Namespace

BarbezDotEu.Twitter.DTO.Entities

Summary

Implements the TweetUrlEntity DTO as defined by the third-party provider.

Description property

Summary

Gets or sets the description.

DisplayUrl property

Summary

Gets or sets the display URL.

ExpandedUrl property

Summary

Gets or sets the expanded URL.

Images property

Summary

Gets or sets the images.

Status property

Summary

Gets or sets the status.

Title property

Summary

Gets or sets the title.

UnwoundUrl property

Summary

Gets or sets the unwound URL.

Url property

Summary

Gets or sets the URL.

TwitterConfiguration type

Namespace

BarbezDotEu.Twitter

Summary

Implements and houses configuration parameters to correctly connect to and communicate with Twitter.com's services.

#ctor(maxCallsPerMinute,resultsPerRequest,searchRecentTweetsUrl,searchRecentTweetsFields,oAuth2TokenUrl,consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters.

Parameters
Name Type Description
maxCallsPerMinute System.String The maximum number of calls allowed per minute (see the Twitter.com developer website for current rates).
resultsPerRequest System.Int64 The maximum number of results to return per request.
searchRecentTweetsUrl System.String The fully-qualified URL to use to search for topics in recent tweets. However, omits the actual search query and query fields.
searchRecentTweetsFields System.String The query fields to query the SearchRecentTweetsUrl with.
oAuth2TokenUrl System.String The OAuth 2 Token URL for authentication.
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

#ctor(maxCallsPerMinute,resultsPerRequest,searchRecentTweetsUrl,searchRecentTweetsFields,oAuth2TokenUrl,consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters.

Parameters
Name Type Description
maxCallsPerMinute System.String The maximum number of calls allowed per minute (see the Twitter.com developer website for current rates).
resultsPerRequest System.String The maximum number of results to return per request.
searchRecentTweetsUrl System.String The fully-qualified URL to use to search for topics in recent tweets. However, omits the actual search query and query fields.
searchRecentTweetsFields System.String The query fields to query the SearchRecentTweetsUrl with.
oAuth2TokenUrl System.String The OAuth 2 Token URL for authentication.
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

#ctor(maxCallsPerMinute,resultsPerRequest,searchRecentTweetsUrl,searchRecentTweetsFields,oAuth2TokenUrl,consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters.

Parameters
Name Type Description
maxCallsPerMinute System.Int64 The maximum number of calls allowed per minute (see the Twitter.com developer website for current rates).
resultsPerRequest System.Int64 The maximum number of results to return per request.
searchRecentTweetsUrl System.String The fully-qualified URL to use to search for topics in recent tweets. However, omits the actual search query and query fields.
searchRecentTweetsFields System.String The query fields to query the SearchRecentTweetsUrl with.
oAuth2TokenUrl System.String The OAuth 2 Token URL for authentication.
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

#ctor(consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters and using some default settings.

Parameters
Name Type Description
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

#ctor(maxCallsPerMinute,consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters and using some default settings.

Parameters
Name Type Description
maxCallsPerMinute System.Int64 The maximum number of calls allowed per minute (see the Twitter.com developer website for current rates).
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

#ctor(maxCallsPerMinute,consumerKey,consumerSecret) constructor

Summary

Constructs a new TwitterConfiguration using given parameters and using some default settings.

Parameters
Name Type Description
maxCallsPerMinute System.String The maximum number of calls allowed per minute (see the Twitter.com developer website for current rates).
consumerKey System.String The consumer key for authentication. (Get yours from the Twitter.com developer website)
consumerSecret System.String The secret for authentication. (Get yours from the Twitter.com developer website)

DEFAULTMAXCALLSPERMINUTE constants

Summary

A constant representing this package's default assumption of the maximum number of calls allowed per minute.

DEFAULTOAUTH2TOKENURL constants

Summary

A constant representing this package's default implementation of the OAuth 2 Token URL for authentication.

DEFAULTRESULTSPERREQUEST constants

Summary

A constant representing this package's default assumption of the maximum number of results to return per request.

DEFAULTSEARCHRECENTTWEETSFIELDS constants

Summary

A constant representing this package's default implementation for the query fields to query the SearchRecentTweetsUrl with.

DEFAULTSEARCHRECENTTWEETSURL constants

Summary

A constant representing this package's default implementation for the fully-qualified URL to use to search for topics in recent tweets. However, omits the actual search query and query fields.

ConsumerKey property

Summary

Gets the consumer key for authentication. (Get yours from the Twitter.com developer website)

ConsumerSecret property

Summary

Gets the consumer secret for authentication. (Get yours from the Twitter.com developer website)

MaxCallsPerMinute property

Summary

Gets the maximum number of calls allowed per minute (see the Twitter developer website for current rates).

OAuth2TokenUrl property

Summary

Gets the OAuth 2 Token URL for authentication.

ResultsPerRequest property

Summary

Gets the maximum number of results to return per request.

SearchRecentTweetsFields property

Summary

Gets the query fields to query the SearchRecentTweetsUrl with.

SearchRecentTweetsUrl property

Summary

Gets the fully-qualified URL to use to search for topics in recent tweets. However, omits the actual search query and query fields.

GetResultsPerRequest(resultsPerRequest) method

Summary

From a given string, parses the max. number of results to return per request. If not possible to parse, returns DEFAULTRESULTSPERREQUEST.

Returns

The maximum number of results to return per request.

Parameters
Name Type Description
resultsPerRequest System.String The string representation of the value of the maximum number of results per request.

TwitterDataProvider type

Namespace

BarbezDotEu.Twitter

Summary

Implements a data provider that connects to and can call Twitter.com APIs.

#ctor(logger,httpClientFactory) constructor

Summary

Constructs a new TwitterDataProvider.

Parameters
Name Type Description
logger Microsoft.Extensions.Logging.ILogger A ILogger to use for logging.
httpClientFactory System.Net.Http.IHttpClientFactory The IHttpClientFactory to use.

Configuration property

Summary

Gets the TwitterConfiguration this TwitterConfiguration uses to communicate to the APIs.

Configure() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetAuthorization() method

Summary

Gets the authentication header value parameter.

Returns

The access token.

Parameters

This method has no parameters.

Remarks

https://developer.twitter.com/en/docs/authentication/oauth-2-0/application-only

GetRecentTweets() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

TweetsAsMicroBlogEntries() method

Summary

Returns a list of Tweets as collection of MicroBlogEntry items.

Returns

A list of Tweets as collection of MicroBlogEntry items.

Parameters

This method has no parameters.

TwitterDataProviderException type

Namespace

BarbezDotEu.Twitter.Exceptions

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

TwitterImage type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TwitterImage DTO as defined by the third-party provider.

Height property

Summary

Gets or sets the height.

Url property

Summary

Gets or sets the URL.

Width property

Summary

Gets or sets the width.

TwitterMetaData type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TwitterMetaData DTO as defined by the third-party provider.

NewestId property

Summary

Gets or sets the newest ID.

NextToken property

Summary

Gets or sets the token for the next results.

OldestId property

Summary

Gets or sets the oldest ID.

ResultCount property

Summary

Gets or sets the result count.

TwitterResponse type

Namespace

BarbezDotEu.Twitter.DTO

Summary

Implements the TwitterResponse DTO as defined by the third-party provider.

Data property

Summary

Gets or sets the data.

TwitterMetaData property

Summary

Gets or sets the meta data.