Increased Direct Message Calls


#1

I am building a twitter integration for the company I work for. Essentially this will allow agents to monitor the twitter account for tweets and direct messages and respond accordingly. I am currently using the public stream to access tweets. I wrote a cron job that would go fetch each account’s direct messages every minute and then process them as necessary. This works fine for brand new messages coming in, however, if an agent responds to a message, I can’t let it wait up to a minute to receive a response. I see user streams get me the direct messages as well, but I need to do this for possibly endless number of accounts. Is there a way to increase rate limits? Can I connect a user stream for each account I wish to follow all under my single twitter app?

Thanks,
Matt


#2

Can I connect a user stream for each account I wish to follow all under my single twitter app?

Your Company’s User Stream: https://dev.twitter.com/streaming/reference/get/user will receive tweets from everyone it follows, including DMs: https://dev.twitter.com/streaming/overview/messages-types#user_stream_messsages so you’ll only need 1 stream connection open - but you are limited to monitoring 10,000 accounts your company follows


#3

I dont think I explained my problem well enough: several external companies could use our app and we would need to receive tweets and dms for each of those accounts. I dont think user streams allow me to get tweets and dms for several other twitter accounts, do they? I’m not sure how I could do that because the user stream is in user context auth. I think each company I want to receive tweets and dms for would need its own user stream.


#4

Ah, yes you’re right - User streams are for 1 account only. But you could run a separate user stream for each company, using their own Access Token - that would work.