update README
This commit is contained in:
@@ -16,8 +16,15 @@ you can use these endpoint
|
|||||||
- statuses/user_timeline
|
- statuses/user_timeline
|
||||||
- favorites/create
|
- favorites/create
|
||||||
- favorites/destroy
|
- favorites/destroy
|
||||||
|
- users/show
|
||||||
- media/upload(support: jpg, jpeg, png, gif, mp4)
|
- media/upload(support: jpg, jpeg, png, gif, mp4)
|
||||||
- direct_messages/events/new (message_create)
|
- direct_messages/events/new (message_create)
|
||||||
|
- oauth/access_token
|
||||||
|
- oauth/authorize
|
||||||
|
- oauth/invalidate_token
|
||||||
|
- oauth/request_token
|
||||||
|
- oauth2/token
|
||||||
|
- oauth2/invalidate_token
|
||||||
|
|
||||||
# Dependency
|
# Dependency
|
||||||
- libcurl(openssl version)
|
- libcurl(openssl version)
|
||||||
@@ -71,6 +78,8 @@ $ mingw32-make
|
|||||||
|
|
||||||
# How
|
# How
|
||||||
## API Key Registration
|
## API Key Registration
|
||||||
|
there're 4 ways to register API key
|
||||||
|
|
||||||
### 1.Write Key into code
|
### 1.Write Key into code
|
||||||
write api key into code and create Key object use it.
|
write api key into code and create Key object use it.
|
||||||
```
|
```
|
||||||
@@ -123,8 +132,9 @@ api.swapKey(key);
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 4. Get BearerToken with AIP call
|
### 4. Get BearerToken with API call
|
||||||
if you want to call Twitter API using Bearer Token; OAuth2, you can do.
|
if you want to call Twitter API using Bearer Token; OAuth2, you can do.
|
||||||
|
also need consumer key and secret
|
||||||
```
|
```
|
||||||
CocoaTweet::API::API api(key);
|
CocoaTweet::API::API api(key);
|
||||||
auto bearerToken = api.oauth2().token();
|
auto bearerToken = api.oauth2().token();
|
||||||
@@ -177,8 +187,10 @@ api.favorite().destroy("tweet id");
|
|||||||
// get a timeline with screen name
|
// get a timeline with screen name
|
||||||
auto timeline = api.status().userTimeline("milkcocoa0902");
|
auto timeline = api.status().userTimeline("milkcocoa0902");
|
||||||
|
|
||||||
|
auto user = api.user().show("milkcocoa0902");
|
||||||
|
|
||||||
// send a direct message
|
// send a direct message
|
||||||
// you cau get recipient_id using https://idtwi.com/
|
// you cau get recipient_id using user.show()
|
||||||
api.directMessage().messageCreate("<recipient_id>", "Sent message using Cocoa Twitter Library");
|
api.directMessage().messageCreate("<recipient_id>", "Sent message using Cocoa Twitter Library");
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user