Table of Contents

Class Utils

Namespace
Twikit
Assembly
Twikit.dll

Python 版 twikit.utils の雑多なヘルパー。

public static class Utils
Inheritance
Utils
Inherited Members

Methods

B64ToStr(string)

Base64 文字列を UTF-8 文字列にデコードします。

public static string B64ToStr(string b64)

Parameters

b64 string

Returns

string

BuildTweetData(JsonObject)

v1.1 形式のツイート JSON を、GraphQL 形式(rest_id と legacy を持つ)に組み替えます。

public static JsonObject BuildTweetData(JsonObject rawData)

Parameters

rawData JsonObject

Returns

JsonObject

BuildUserData(JsonObject)

v1.1 形式のユーザー JSON を、GraphQL 形式(rest_id と legacy を持つ)に組み替えます。

public static JsonObject BuildUserData(JsonObject rawData)

Parameters

rawData JsonObject

Returns

JsonObject

FlattenParams(IEnumerable<KeyValuePair<string, JsonNode?>>)

クエリ文字列用に、オブジェクト・配列の値を JSON 文字列に平坦化します。

public static Dictionary<string, string> FlattenParams(IEnumerable<KeyValuePair<string, JsonNode?>> parameters)

Parameters

parameters IEnumerable<KeyValuePair<string, JsonNode>>

Returns

Dictionary<string, string>

GetQueryId(string)

GraphQL URL からクエリ ID を取り出します(.../graphql/{id}/{name})。

public static string GetQueryId(string url)

Parameters

url string

Returns

string

SnowflakeToTimestampMs(string)

ツイート ID(Snowflake)から作成時刻(ミリ秒)を復元します。

public static long SnowflakeToTimestampMs(string tweetId)

Parameters

tweetId string

Returns

long

TimestampToDateTime(string)

X の日時表記(Wed Oct 10 20:19:24 +0000 2018)を DateTimeOffset にします。

public static DateTimeOffset TimestampToDateTime(string timestamp)

Parameters

timestamp string

Returns

DateTimeOffset