Skip to content

Instantly share code, notes, and snippets.

@scruffyfox
Created March 25, 2013 09:45
Show Gist options
  • Select an option

  • Save scruffyfox/5236035 to your computer and use it in GitHub Desktop.

Select an option

Save scruffyfox/5236035 to your computer and use it in GitHub Desktop.
App.net Filter for use in a stream receiving private messages and posts. Specify ['post', 'message'] as value for the 'object_types' field when creating (or updating) a stream. This filter will catch mentions in posts and private messages sent to any of the users using your ADN app.
Filter:
"match_policy":"include_any",
"clauses":[
{
"operator":"one_of",
"field":"\/data\/entities\/mentions\/*\/id",
"object_type":"post",
"value":"$authorized_userids"
},
{
"operator":"one_of",
"field":"\/meta\/channel_type",
"object_type":"message",
"value":[
"net.app.core.pm"
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment