C# Class OpenTween.Twitter

Inheritance: IDisposable
Show file Open project: opentween/OpenTween Class Usage Examples

Public Properties

Property Type Description
DMSendTextRegex System.Text.RegularExpressions.Regex
StatusUrlRegex System.Text.RegularExpressions.Regex
ThirdPartyStatusUrlRegex System.Text.RegularExpressions.Regex
storedEvent_ List

Public Methods

Method Description
ClearAuthInfo ( ) : void
ContainsUserAtList ( long listId, string user ) : Task
CreateHtmlAnchor ( string text, List AtList, TwitterEntities entities, List media ) : string
CreateListApi ( string listName, bool isPrivate, string description ) : System.Threading.Task
DeleteList ( long listId ) : System.Threading.Task
Dispose ( ) : void
EditList ( long listId, string new_name, bool isPrivate, string description ) : Task
GetApiResultCount ( MyCommon type, bool more, bool startup ) : int

WORKERTYPEに応じた取得件数を取得する

GetDirectMessageApi ( bool read, MyCommon gType, bool more ) : System.Threading.Task
GetFavoritesApi ( bool read, FavoritesTabModel tab, bool backward ) : System.Threading.Task
GetHashList ( ) : string[]
GetHomeTimelineApi ( bool read, HomeTabModel tab, bool more, bool startup ) : System.Threading.Task
GetInfoApi ( ) : Task
GetListMembers ( long listId, List lists, long cursor ) : Task
GetListStatus ( bool read, ListTimelineTabModel tab, bool more, bool startup ) : System.Threading.Task
GetListsApi ( ) : System.Threading.Task
GetMaxApiResultCount ( MyCommon type ) : int

WORKERTYPEに応じた取得可能な最大件数を取得する

GetMentionsTimelineApi ( bool read, MentionsTabModel tab, bool more, bool startup ) : System.Threading.Task
GetQuoteTweetStatusIds ( IEnumerable entities ) : IEnumerable

ツイートに含まれる引用ツイートのURLからステータスIDを抽出

GetQuoteTweetStatusIds ( IEnumerable urls ) : IEnumerable
GetRelatedResult ( bool read, RelatedPostsTabModel tab ) : System.Threading.Task
GetSearch ( bool read, PublicSearchTabModel tab, bool more ) : System.Threading.Task
GetStatusApi ( bool read, long id, TabModel tab ) : System.Threading.Task
GetStatusApi ( bool read, long id ) : Task
GetTextLengthRemain ( string postText ) : int
GetUserTimelineApi ( bool read, string userName, UserTimelineTabModel tab, bool more ) : System.Threading.Task
Initialize ( string token, string tokenSecret, string username, long userId ) : void
ParseSource ( string sourceHtml ) : Uri>.Tuple

Twitter APIから得たHTML形式のsource文字列を分析し、source名とURLに分離します

PostRetweet ( long id, bool read ) : System.Threading.Task
PostStatus ( string postStr, long reply_to, IReadOnlyList mediaIds = null ) : System.Threading.Task
PreProcessUrl ( string orgData ) : string
ReconnectUserStream ( ) : void
RefreshBlockIds ( ) : System.Threading.Task

ブロック中のユーザーを更新します

RefreshConfiguration ( ) : System.Threading.Task

t.co の文字列長などの設定情報を更新します

RefreshFollowerIds ( ) : System.Threading.Task

フォロワーIDを更新します

RefreshMuteUserIdsAsync ( ) : System.Threading.Task

ミュート中のユーザーIDを更新します

RefreshNoRetweetIds ( ) : System.Threading.Task

RT 非表示ユーザーを更新します

SendDirectMessage ( string postStr ) : System.Threading.Task
StartUserStream ( ) : void
StopUserStream ( ) : void
Twitter ( ) : System.Diagnostics
Twitter ( TwitterApi api ) : System.Diagnostics
UploadMedia ( IMediaItem item ) : Task
VerifyApiResultCount ( MyCommon type, int count ) : bool

渡された取得件数がWORKERTYPEに応じた取得可能範囲に収まっているか検証する

VerifyCredentialsAsync ( ) : System.Threading.Task
VerifyFirstApiResultCount ( int count ) : bool

渡された取得件数が起動時の取得可能範囲に収まっているか検証する

VerifyMoreApiResultCount ( int count ) : bool

渡された取得件数が更新時の取得可能範囲に収まっているか検証する

Protected Methods

Method Description
Dispose ( bool disposing ) : void
ResetApiStatus ( ) : void

Private Methods

Method Description
CheckAccessLevel ( TwitterApiAccessLevel accessLevelFlags ) : void
CheckAccountState ( ) : void
CreateAccessibleText ( string text, TwitterEntities entities, TwitterStatus quoteStatus ) : string
CreateDirectMessagesFromJson ( TwitterDirectMessage item, MyCommon gType, bool read ) : void
CreateEventFromJson ( string content ) : void
CreateEventFromRetweet ( System.Xml.Linq.XElement xElm ) : FormattedEvent

UserStreamsから受信した公式RTをイベントに変換します

CreateFavoritePostsFromJson ( TwitterStatus items, bool read ) : long?
CreatePostsFromJson ( TwitterStatus items, MyCommon gType, TabModel tab, bool read ) : long?
CreatePostsFromSearchJson ( TwitterSearchResult items, PublicSearchTabModel tab, bool read, bool more ) : long?
CreatePostsFromStatusData ( TwitterStatus status ) : OpenTween.PostClass
CreatePostsFromStatusData ( TwitterStatus status, bool favTweet ) : OpenTween.PostClass
FindTopOfReplyChain ( PostClass>.IDictionary posts, System.Int64 startStatusId ) : OpenTween.PostClass

startStatusId からリプライ先の発言を辿る。発言は posts 以外からは検索しない。

GetTextLengthRemainInternal ( string postText, bool isDm ) : int
ReplaceTextFromApi ( string text, TwitterEntities entities ) : string
UpdateUserStats ( TwitterUser self ) : void

ユーザーのフォロワー数などの情報を更新します

VerifyCredentials ( ) : void
userStream_Started ( ) : void
userStream_StatusArrived ( string line ) : void
userStream_Stopped ( ) : void

Method Details

ClearAuthInfo() public method

public ClearAuthInfo ( ) : void
return void

ContainsUserAtList() public method

public ContainsUserAtList ( long listId, string user ) : Task
listId long
user string
return Task

CreateHtmlAnchor() public method

public CreateHtmlAnchor ( string text, List AtList, TwitterEntities entities, List media ) : string
text string
AtList List
entities TwitterEntities
media List
return string

CreateListApi() public method

public CreateListApi ( string listName, bool isPrivate, string description ) : System.Threading.Task
listName string
isPrivate bool
description string
return System.Threading.Task

DeleteList() public method

public DeleteList ( long listId ) : System.Threading.Task
listId long
return System.Threading.Task

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EditList() public method

public EditList ( long listId, string new_name, bool isPrivate, string description ) : Task
listId long
new_name string
isPrivate bool
description string
return Task

GetApiResultCount() public static method

WORKERTYPEに応じた取得件数を取得する
public static GetApiResultCount ( MyCommon type, bool more, bool startup ) : int
type MyCommon
more bool
startup bool
return int

GetDirectMessageApi() public method

public GetDirectMessageApi ( bool read, MyCommon gType, bool more ) : System.Threading.Task
read bool
gType MyCommon
more bool
return System.Threading.Task

GetFavoritesApi() public method

public GetFavoritesApi ( bool read, FavoritesTabModel tab, bool backward ) : System.Threading.Task
read bool
tab FavoritesTabModel
backward bool
return System.Threading.Task

GetHashList() public method

public GetHashList ( ) : string[]
return string[]

GetHomeTimelineApi() public method

public GetHomeTimelineApi ( bool read, HomeTabModel tab, bool more, bool startup ) : System.Threading.Task
read bool
tab HomeTabModel
more bool
startup bool
return System.Threading.Task

GetInfoApi() public method

public GetInfoApi ( ) : Task
return Task

GetListMembers() public method

public GetListMembers ( long listId, List lists, long cursor ) : Task
listId long
lists List
cursor long
return Task

GetListStatus() public method

public GetListStatus ( bool read, ListTimelineTabModel tab, bool more, bool startup ) : System.Threading.Task
read bool
tab ListTimelineTabModel
more bool
startup bool
return System.Threading.Task

GetListsApi() public method

public GetListsApi ( ) : System.Threading.Task
return System.Threading.Task

GetMaxApiResultCount() public static method

WORKERTYPEに応じた取得可能な最大件数を取得する
public static GetMaxApiResultCount ( MyCommon type ) : int
type MyCommon
return int

GetMentionsTimelineApi() public method

public GetMentionsTimelineApi ( bool read, MentionsTabModel tab, bool more, bool startup ) : System.Threading.Task
read bool
tab MentionsTabModel
more bool
startup bool
return System.Threading.Task

GetQuoteTweetStatusIds() public static method

ツイートに含まれる引用ツイートのURLからステータスIDを抽出
public static GetQuoteTweetStatusIds ( IEnumerable entities ) : IEnumerable
entities IEnumerable
return IEnumerable

GetQuoteTweetStatusIds() public static method

public static GetQuoteTweetStatusIds ( IEnumerable urls ) : IEnumerable
urls IEnumerable
return IEnumerable

GetRelatedResult() public method

public GetRelatedResult ( bool read, RelatedPostsTabModel tab ) : System.Threading.Task
read bool
tab RelatedPostsTabModel
return System.Threading.Task

GetSearch() public method

public GetSearch ( bool read, PublicSearchTabModel tab, bool more ) : System.Threading.Task
read bool
tab PublicSearchTabModel
more bool
return System.Threading.Task

GetStatusApi() public method

public GetStatusApi ( bool read, long id, TabModel tab ) : System.Threading.Task
read bool
id long
tab TabModel
return System.Threading.Task

GetStatusApi() public method

public GetStatusApi ( bool read, long id ) : Task
read bool
id long
return Task

GetTextLengthRemain() public method

public GetTextLengthRemain ( string postText ) : int
postText string
return int

GetUserTimelineApi() public method

public GetUserTimelineApi ( bool read, string userName, UserTimelineTabModel tab, bool more ) : System.Threading.Task
read bool
userName string
tab UserTimelineTabModel
more bool
return System.Threading.Task

Initialize() public method

public Initialize ( string token, string tokenSecret, string username, long userId ) : void
token string
tokenSecret string
username string
userId long
return void

ParseSource() public static method

Twitter APIから得たHTML形式のsource文字列を分析し、source名とURLに分離します
public static ParseSource ( string sourceHtml ) : Uri>.Tuple
sourceHtml string
return Uri>.Tuple

PostRetweet() public method

public PostRetweet ( long id, bool read ) : System.Threading.Task
id long
read bool
return System.Threading.Task

PostStatus() public method

public PostStatus ( string postStr, long reply_to, IReadOnlyList mediaIds = null ) : System.Threading.Task
postStr string
reply_to long
mediaIds IReadOnlyList
return System.Threading.Task

PreProcessUrl() public method

public PreProcessUrl ( string orgData ) : string
orgData string
return string

ReconnectUserStream() public method

public ReconnectUserStream ( ) : void
return void

RefreshBlockIds() public method

ブロック中のユーザーを更新します
public RefreshBlockIds ( ) : System.Threading.Task
return System.Threading.Task

RefreshConfiguration() public method

t.co の文字列長などの設定情報を更新します
public RefreshConfiguration ( ) : System.Threading.Task
return System.Threading.Task

RefreshFollowerIds() public method

フォロワーIDを更新します
public RefreshFollowerIds ( ) : System.Threading.Task
return System.Threading.Task

RefreshMuteUserIdsAsync() public method

ミュート中のユーザーIDを更新します
public RefreshMuteUserIdsAsync ( ) : System.Threading.Task
return System.Threading.Task

RefreshNoRetweetIds() public method

RT 非表示ユーザーを更新します
public RefreshNoRetweetIds ( ) : System.Threading.Task
return System.Threading.Task

ResetApiStatus() protected method

protected ResetApiStatus ( ) : void
return void

SendDirectMessage() public method

public SendDirectMessage ( string postStr ) : System.Threading.Task
postStr string
return System.Threading.Task

StartUserStream() public method

public StartUserStream ( ) : void
return void

StopUserStream() public method

public StopUserStream ( ) : void
return void

Twitter() public method

public Twitter ( ) : System.Diagnostics
return System.Diagnostics

Twitter() public method

public Twitter ( TwitterApi api ) : System.Diagnostics
api TwitterApi
return System.Diagnostics

UploadMedia() public method

public UploadMedia ( IMediaItem item ) : Task
item IMediaItem
return Task

VerifyApiResultCount() public static method

渡された取得件数がWORKERTYPEに応じた取得可能範囲に収まっているか検証する
public static VerifyApiResultCount ( MyCommon type, int count ) : bool
type MyCommon
count int
return bool

VerifyCredentialsAsync() public method

public VerifyCredentialsAsync ( ) : System.Threading.Task
return System.Threading.Task

VerifyFirstApiResultCount() public static method

渡された取得件数が起動時の取得可能範囲に収まっているか検証する
public static VerifyFirstApiResultCount ( int count ) : bool
count int
return bool

VerifyMoreApiResultCount() public static method

渡された取得件数が更新時の取得可能範囲に収まっているか検証する
public static VerifyMoreApiResultCount ( int count ) : bool
count int
return bool

Property Details

DMSendTextRegex public static property

DM送信かどうかを判定する正規表現
public static Regex,System.Text.RegularExpressions DMSendTextRegex
return System.Text.RegularExpressions.Regex

StatusUrlRegex public static property

ツイートへのパーマリンクURLを判定する正規表現
public static Regex,System.Text.RegularExpressions StatusUrlRegex
return System.Text.RegularExpressions.Regex

ThirdPartyStatusUrlRegex public static property

FavstarやaclogなどTwitter関連サービスのパーマリンクURLからステータスIDを抽出する正規表現
public static Regex,System.Text.RegularExpressions ThirdPartyStatusUrlRegex
return System.Text.RegularExpressions.Regex

storedEvent_ public property

public List storedEvent_
return List