-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up code. V2 POST Tweet endpoint now works with Oauth v1
- Loading branch information
1 parent
b202edc
commit e87fdb5
Showing
3 changed files
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import ../src/xnim | ||
|
||
when isMainModule: | ||
const API_KEY: string = "APIKEY" | ||
const OAUT_TOKEN: string = "OAUT_TOKEN" | ||
|
||
const xCli: XAPI = newXAPI(API_KEY, OAUT_TOKEN) | ||
let res: string = xCli.PostTextTweet("From X.nim") | ||
echo res | ||
# This is API Key | ||
const CONSUMER_KEY: string = "CONSUMERKEY" | ||
|
||
# This is the API secret key | ||
const CONSUMER_SECRET: string = "CONSUMERSECRET" | ||
|
||
# This is the Authentication Access Token | ||
const ACCESS_TOKEN: string = "ACCESSTOKEN" | ||
|
||
# This is the Authentication Access Secret | ||
const TOKEN_SECRET: string = "TOKENSECRET" | ||
|
||
const xCli: XAPI = newXAPI(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, TOKEN_SECRET) | ||
let res: string = xCli.PostTextTweet("Hello from X.nim!") | ||
echo res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ srcDir = "src" | |
# Dependencies | ||
|
||
requires "nim >= 2.0.0" | ||
|
||
requires "nimcrypto >= 0.6.0" |