See Twitter search results in Zulip! This is great for seeing and discussing who is talking about you, friends, competitors, or important topics in real time.
First, create the stream you'd like to use for tweets, and subscribe
all interested parties to this stream. We recommend the
name twitter
.
Next, download and install our Python bindings and example scripts. This bot should be set up on a trusted machine, because your API key is visible to local users through the command line or config file.
Next, install version 1.0 or later of
the twitter-python
library. If your operating system
distribution doesn't package a new enough version, you can install the
library from source from
the GitHub repository.
Next, set up Twitter authentication. This bot uses OAuth to authenticate with Twitter, and in order to obtain a consumer key & secret, you must register a new application under your Twitter account:
To configure and deploy this bot:
~/.zulip_twitterrc
with the following
contents:
[twitter] consumer_key = consumer_secret = access_token_key = access_token_secret =
/usr/local/share/zulip/integrations/twitter/twitter-search-bot --search="@nprnews,quantum physics" --site={{ external_api_uri_subdomain }}Note:
twitter-search-bot
may install to a different
location on your operating system distribution.
* * * * * /usr/local/share/zulip/integrations/twitter/twitter-search-bot --search="@nprnews,quantum physics" --site={{ external_api_uri_subdomain }}
Congratulations! You're done!
When someone tweets a
message containing one of your search terms, you'll get a Zulip on your
specified stream, with the search term as the topic.
Note that the twitter search bot integration
just sends links to tweets; the pretty inline previews of tweets are
generated by the Twitter card rendering integration configured
in /etc/zulip/settings.py
on the Zulip server.