botkit icon indicating copy to clipboard operation
botkit copied to clipboard

Twitter support

Open imraansarwar opened this issue 10 years ago • 15 comments

Hi, Do you have any plans to support twitter streaming APIs? Can you give me some pointers to start with?

Any help would be much appreciated.

Regards, Imran

imraansarwar avatar Nov 06 '16 10:11 imraansarwar

If anyone has access to some documentation, we'd be glad to take a look but it appears that is not public yet?

peterswimm avatar Nov 07 '16 18:11 peterswimm

@peterswimm @imraansarwar - There seems to be an API, though quite restricted: https://dev.twitter.com/overview/terms/policy https://support.twitter.com/articles/76915

According to this thread, the API isn't very suiting for bots as we know them on Slack / FB: https://twittercommunity.com/t/how-to-make-a-twitterbot/2884/8

agamrafaeli avatar Nov 08 '16 08:11 agamrafaeli

@peterswimm @imraansarwar Thanks for your response.

Well, I tend to disagree that bot development with twitter APIs is difficult In my opinion, their policy is more flexible than Facebook, though they discourage spamming, which makes lot of sense.

I just developed the POC using excellent nodejs lib, i.e. Twit: https://github.com/ttezel/twit. I used Twitter streaming APIs for the simple bot, and I'm successfully receiving user direct messages, mentions and responding to it through the bot.

There's sufficient documentation available on twitter official website (except for some events) however its not a show stopper as the json response is self-sufficient to understand the attributes, you can access that even without login in to your account. Example using twit nodejs library: http://thealphanerd.io/blog/what-exactly-is-talkpaybot-how-to-make-simple-bots-with-the-twitter-stream-api/

Another nodejs library is: https://www.npmjs.com/package/twitter along with an example: http://techknights.org/workshops/nodejs-twitterbot/

Some pointers to Twitter Documentation Overview: https://dev.twitter.com/streaming/overview User Streams: https://dev.twitter.com/streaming/userstreams EndPoint to recieve user stream messages (Mentions, Direct messages, Follow events) https://dev.twitter.com/streaming/reference/get/user EndPoint to send direct messages: https://dev.twitter.com/rest/reference/post/direct_messages/new Resftul Endpoints: https://dev.twitter.com/rest/public

I think adding support for twitter will make botkit the greatest of the bot development frameworks out their.

Cheers, Imran

imraansarwar avatar Nov 10 '16 18:11 imraansarwar

@agamrafaeli @peterswimm Guys can you give me some pointers, on how to integrate botkit with twitt? Any help would be appreciated.

Regards, Imran

imraansarwar avatar Nov 20 '16 09:11 imraansarwar

@imraansarwar You should take a look at the facebook middleware for tips: https://github.com/howdyai/botkit/blob/master/facebook_bot.js

We hope to have better how-to documentation for middleware sooner than later!

peterswimm avatar Nov 20 '16 22:11 peterswimm

I'd love to have botkit working with twitter - let me know if I can help - also we have a big open source community at http://agileventures.org with a slack where we could get together to work on this if @imraansarwar needs help ....

tansaku avatar Dec 12 '16 11:12 tansaku

Hi Sam, @tansaku If you can help that would be awesome, I'm and experienced java developer but new to nodejs :( I definitely need a head-start to add support for twitter in howdy. I'm already using howdy with facebook with great success. Note: I'm using Twit [https://github.com/ttezel/twit] for integrating with twitter. And I'm intending to use Direct Chat APIs from twitter. Thanks

imraansarwar avatar Dec 15 '16 11:12 imraansarwar

Has twitter released any information on quick replies? Direct messaging is probably the strongest use for botkit on twitter in my mind.

peterswimm avatar Dec 15 '16 13:12 peterswimm

hi @imraansarwar - very happy to help you - if you sign up at http://agileventures.org you'll get an invite to our slack instance - we have lots of separate project channels for OS projects - mostly Ruby on Rails, but a couple of node projects too. happy to help just in github too - also happy to host projects at http://github.com/AgileVentures

I'm not familiar with extending botkit - do we need to fork the whole repo? or create a standalone plugin? Happy to create a project on AgileVentures to try and funnel more support in your direction ...

tansaku avatar Dec 16 '16 11:12 tansaku

@tansaku I would extend botkit much like we did to add facebook support: https://github.com/howdyai/botkit/blob/master/readme-facebook.md

If anyone want to ask questions about this, feel free to discuss with our team on dev4slack!

peterswimm avatar Dec 19 '16 22:12 peterswimm

thanks @peterswimm - yes - seems like we just create an appropriate bot file in botkit/lib - how does one access dev4slack?

tansaku avatar Dec 20 '16 10:12 tansaku

@tansaku Sign up here

peterswimm avatar Dec 20 '16 14:12 peterswimm

This is now public:

https://twittercommunity.com/t/new-direct-message-api-features-now-available-to-all/98733

peterswimm avatar Dec 20 '17 16:12 peterswimm

In light of recent platform changes this is no longer possible.

peterswimm avatar Jul 27 '18 19:07 peterswimm

@peterswimm Can you give more info about why it is not possible?. That means that botkit is unable to support twitter?

hendrul avatar Dec 14 '18 17:12 hendrul