Change the Twitter API call to follow a UserId set #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background information
For the use case of tracking a user's tweets/replies/mentions, the
filter.keywords
property can be exploited to scan for tweets containing the user's Twitter handle. This is supported by the "track" request paramater of the API endpoint, and can sometimes perform acceptably for mentions and replies.But to select for a user's tweets themselves, only in the rare case that a user's tweet contains their own username will it be captured—since the matching keywords must appear somewhere in the tweet body. Otherwise, the connector currently has no way of tracking tweets originating from a given account.
However, the API also provides us with a
follow
request parameter (see the doc referred to above), which can bring to bear the desired tweets.Implementation summary
FilterQuery
via itsfollow
methodBefore & after
After this change, the
filter.userIds
property, a comma-separated list of UserId values will be allowed (which could be an empty string, which is the default), and if specified will allow the connector to follow tweets originating from, replying to, or mentioning the listed users.In addition, the connector will continue to track all other tweets that contain any specified filter keywords in their text.