Last active
April 21, 2018 22:34
-
-
Save WimDoetApp/daee2d26d37a5d4b8c887dc1173090f1 to your computer and use it in GitHub Desktop.
search twitter for hashtag using webtask.io
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
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