This repository has been archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove duplicate code on examples
- Loading branch information
1 parent
96a9079
commit f60d528
Showing
3 changed files
with
12 additions
and
18 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,22 +1,20 @@ | ||
/* eslint-disable no-console */ | ||
const twitterize = require('../src') | ||
|
||
// https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update.html | ||
|
||
// https://developer.twitter.com/en/apps/ | ||
const twit = twitterize({ | ||
const twitterize = require('../src')({ | ||
api_key: process.env.TWITTER_API_KEY, | ||
api_secret_key: process.env.TWITTER_API_SECRET_KEY, | ||
access_token: process.env.TWITTER_ACCESS_TOKEN, | ||
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET, | ||
}) | ||
|
||
// https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update.html | ||
|
||
const options = { | ||
requestMethod: 'POST', | ||
endpoint: '/statuses/update.json', | ||
bodyParams: { status: 'Hello World!' }, | ||
} | ||
|
||
twit(options) | ||
twitterize(options) | ||
.then(console.log) | ||
.catch(console.log) |
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