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
b64string
Returns
BuildTweetData(JsonObject)
v1.1 形式のツイート JSON を、GraphQL 形式(rest_id と legacy を持つ)に組み替えます。
public static JsonObject BuildTweetData(JsonObject rawData)
Parameters
rawDataJsonObject
Returns
BuildUserData(JsonObject)
v1.1 形式のユーザー JSON を、GraphQL 形式(rest_id と legacy を持つ)に組み替えます。
public static JsonObject BuildUserData(JsonObject rawData)
Parameters
rawDataJsonObject
Returns
FlattenParams(IEnumerable<KeyValuePair<string, JsonNode?>>)
クエリ文字列用に、オブジェクト・配列の値を JSON 文字列に平坦化します。
public static Dictionary<string, string> FlattenParams(IEnumerable<KeyValuePair<string, JsonNode?>> parameters)
Parameters
parametersIEnumerable<KeyValuePair<string, JsonNode>>
Returns
GetQueryId(string)
GraphQL URL からクエリ ID を取り出します(.../graphql/{id}/{name})。
public static string GetQueryId(string url)
Parameters
urlstring
Returns
SnowflakeToTimestampMs(string)
ツイート ID(Snowflake)から作成時刻(ミリ秒)を復元します。
public static long SnowflakeToTimestampMs(string tweetId)
Parameters
tweetIdstring
Returns
TimestampToDateTime(string)
X の日時表記(Wed Oct 10 20:19:24 +0000 2018)を DateTimeOffset にします。
public static DateTimeOffset TimestampToDateTime(string timestamp)
Parameters
timestampstring