Mobile notifications and filtering through API


#1

I have a question similar to the one here:

http://stackoverflow.com/questions/19271000/get-a-list-of-users-for-whom-mobile-notifications-has-been-enabled-on-twitter

So, is it possible to get

  • List of users for whom mobile notification is enabled.
  • If not that, filter the timeline (through either REST or Streaming API) only to show (re/)tweets from users the mobile notification has been enabled for.

#2

No, that information is a private setting on a per-account basis, you cannot access other users’ settings in the API.

No. You can filter Retweets etc. out from your queries, but there’s no way to do this on the basis of what other people have chosen as their local mobile notification settings.


#3

Thanks. Sorry if I didn’t put it the right way earlier, I didn’t mean to access the list for other users. I mean to get (through an API) the subset of my following (ie. https://twitter.com/following) for whom I have enabled the mobile notifications.

Again, here I meant that I need to filter my timeline based on my mobile notification settings.

Basically, my use case here is to get notifications in ways other just through android notifications. Many a time they get overwritten (I guess there is a limit on notifications?), sometimes I just clear them. I needed a way to persist them somehow to something like getpocket.com. It would have been great if I could do that on twitter android client itself, ie. see my previous user notifications.

Thanks again.


#4

Oh, you mean if you “Enable Mobile Notifications” on some profile on Twitter? In that case, if you use your own Access Token and lookup / show a user - the User will have a "notifications":true property

So you could get all the accounts you’re following with /friends/ids, look up all users with /users/lookup and check for “notifications” property on each - once you have a set of users you want notifications for, you can do whatever you want.

You can make your own custom “notification” for your self, with your UserStream https://dev.twitter.com/streaming/userstreams#Data_from_accounts_the_user_follows - and implement a check for retweets or tweets or replies or some other condition, from accounts that you are following and that have "notification":true (I think the user stream will send a user object along with a tweet, so you don’t need to lookup the user for every tweet in your home timeline)


#5

Thank you Igor. That indeed works. Used this for a proof of concept notification router here: https://github.com/ronin13/twitfier.

“notification”:true (I think the user stream will send a user object along with a tweet, so you don’t need to lookup the user for every tweet in your home timeline)

However, there is (or at least was, last I tested) a bug that I hit in that, notifications property in UserStream (user) doesn’t seem to work consistently. Hence, I need to lookup each user with users/lookup and check for notifications property.

Is there a place to report bug in the API. Thanks.


#6

Cool! I’m not good with javascript - but if i’m reading that right - it’s probably best to lookup users in bulk (lookup can do 100 user ids per call) at the start and store them, rather than hitting the lookup API for every single User stream event