DefinitelyTyped/types/twit/twit-tests.ts
2019-02-04 20:39:29 +01:00

19 lines
428 B
TypeScript

import Twit = require('twit');
const t = new Twit( {
consumer_key: '',
consumer_secret: '',
app_only_auth: true,
} );
t.post('statuses/update', { status: 'hello!' }).then(res => {
const status = res.data as Twit.Twitter.Status
console.log(status.id_str)
console.log(res.resp.statusCode)
})
t.stream('statuses/filter', {
track: ['#love','#goscha'],
follow: ['40436619', '606663038', '14466815']
})