サンプルみたいな感じにした
This commit is contained in:
+11
-2
@@ -3,10 +3,19 @@
|
|||||||
|
|
||||||
auto main() -> int {
|
auto main() -> int {
|
||||||
// キーオブジェクトを作成
|
// キーオブジェクトを作成
|
||||||
CocoaTweet::OAuth::Key key = CocoaTweet::OAuth::Key::fromJsonFile("test.json");
|
// auto consumerKey = "your consumer key";
|
||||||
|
// auto consumerSecret = "your consumer secret";
|
||||||
|
// auto accessToken = "your access token";
|
||||||
|
// auto accessTokenSecret = "your access token secret";
|
||||||
|
// CocoaTweet::OAuth::Key key = CocoaTweet::OAuth::Key(consumerKey, consumerSecret,
|
||||||
|
// accessToken, accessTokenSecret);
|
||||||
|
|
||||||
|
// jsonファイルから各種キーを読み込むことも可能
|
||||||
|
CocoaTweet::OAuth::Key key = CocoaTweet::OAuth::Key::fromJsonFile("apikey.json");
|
||||||
|
|
||||||
// 作成したキーオブジェクトを用いてAPIを立ち上げる.
|
// 作成したキーオブジェクトを用いてAPIを立ち上げる.
|
||||||
// 内部的にはキーオブジェクトを使用してOAuth認証機を立ち上げている.
|
// 内部的にはキーオブジェクトを使用してOAuth認証機を立ち上げている.
|
||||||
CocoaTweet::API::API api(key);
|
CocoaTweet::API::API api(key);
|
||||||
|
|
||||||
api.status().Update("CocoaTwitterLibraryからテストツイートしています.\n昨日の反省を生かしてAPI-KeyをJsonファイルから読み込めるようにしたよ");
|
api.status().Update("Hello Twitter World from Cocoa Twitter Library");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user