-
-
Save LucasLeRay/dd210f93f282b1711ec07f9d2dbedf15 to your computer and use it in GitHub Desktop.
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
const Twit = require("twit"); // import Twit library | |
const T = new Twit({ | |
consumer_key: "YOUR API CONSUMER KEY", | |
consumer_secret: "YOUR API SECRETCONSUMER KEY", | |
access_token: "YOUR API ACCESS TOKEN", | |
access_token_secret: "YOUR API SECRET ACCESS TOKEN", | |
}); // setup Twit | |
T.get( | |
"search/tweets", // retrieving tweets | |
{ | |
q: "Donald Trump", // Get tweets containing "Donald Trump" | |
count: 10, // Get the last 10 tweets | |
}, | |
(err, { statuses }) => console.log(statuses) // our tweets! 🎉🎉🎉 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment