Skip to content

Instantly share code, notes, and snippets.

@WimDoetApp
Last active April 21, 2018 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WimDoetApp/daee2d26d37a5d4b8c887dc1173090f1 to your computer and use it in GitHub Desktop.
Save WimDoetApp/daee2d26d37a5d4b8c887dc1173090f1 to your computer and use it in GitHub Desktop.
search twitter for hashtag using webtask.io
var Twit = require('twit')
var output;
var T = new Twit({
consumer_key: '..',
consumer_secret: '..',
access_token: '..',
access_token_secret: '..',
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
})
module.exports = function (context, cb) {
var zoekQuery = context.query.q;
zoekQuery = zoekQuery.replace(/\s/g, '');
var wachtwoord = context.query.w;
if(wachtwoord === "wimnaudts"){
T.get('search/tweets', { q: '#' + zoekQuery, tweet_mode: 'extended', count: 100 }, function(err, data, response) {
output = data;
cb(null, data);
});
}else{
cb(null, 'No access!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment