All Projects → twitterdev → Account Activity Dashboard

twitterdev / Account Activity Dashboard

Licence: apache-2.0
Sample web app and helper scripts to get started with the premium Account Activity API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Account Activity Dashboard

Tradingview Webhook Bot
⚙️ Send TradingView alerts to Telegram, Discord, Slack, Twitter and/or Email.
Stars: ✭ 135 (+4.65%)
Mutual labels:  webhook, twitter
Autohook
Automatically setup and serve webhooks for the Twitter Account Activity API
Stars: ✭ 67 (-48.06%)
Mutual labels:  webhook, twitter
Twitter Webhook Boilerplate Node
A simple Node.js app using Express 4 for Twitter DMs and webhooks.
Stars: ✭ 69 (-46.51%)
Mutual labels:  webhook, twitter
Twitter Python Ads Sdk
A Twitter supported and maintained Ads API SDK for Python.
Stars: ✭ 114 (-11.63%)
Mutual labels:  twitter
Decryptlogin
APIs for loginning some websites by using requests.
Stars: ✭ 1,861 (+1342.64%)
Mutual labels:  twitter
Gitwebhookproxy
A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!
Stars: ✭ 123 (-4.65%)
Mutual labels:  webhook
Rust Slack
A rust crate for sending messages to Slack via webhooks
Stars: ✭ 128 (-0.78%)
Mutual labels:  webhook
Protest Detection Violence Estimation
Implementation of the model used in the paper Protest Activity Detection and Perceived Violence Estimation from Social Media Images (ACM Multimedia 2017)
Stars: ✭ 114 (-11.63%)
Mutual labels:  twitter
Tsuru
desktop client.
Stars: ✭ 126 (-2.33%)
Mutual labels:  twitter
Sharer.js
🔛 🔖 Create your own social share buttons. No jquery.
Stars: ✭ 1,624 (+1158.91%)
Mutual labels:  twitter
React Tweet Embed
component that you supply tweet id and you'll get a tweet embed back, nothing more
Stars: ✭ 120 (-6.98%)
Mutual labels:  twitter
Twittnuker
Android 4.0+ Twitter Client
Stars: ✭ 117 (-9.3%)
Mutual labels:  twitter
Prom2teams
prom2teams is an HTTP server built with Python that receives alert notifications from a previously configured Prometheus Alertmanager instance and forwards it to Microsoft Teams using defined connectors
Stars: ✭ 122 (-5.43%)
Mutual labels:  webhook
Dankenstein
Markov Chain Twitter Bot generator
Stars: ✭ 117 (-9.3%)
Mutual labels:  twitter
Assent
Multi-provider framework in Elixir
Stars: ✭ 126 (-2.33%)
Mutual labels:  twitter
Twidere Ios
Twidere for iOS
Stars: ✭ 115 (-10.85%)
Mutual labels:  twitter
Botserver
http://telegram.org Bot API Webhooks Framework, for Rubyists
Stars: ✭ 125 (-3.1%)
Mutual labels:  webhook
Stocklook
crypto currency library for trading & market making bots, account management, and data analysis
Stars: ✭ 119 (-7.75%)
Mutual labels:  twitter
Faitagram
(Doesn't work anymore)
Stars: ✭ 117 (-9.3%)
Mutual labels:  twitter
Twurl
OAuth-enabled curl for the Twitter API
Stars: ✭ 1,648 (+1177.52%)
Mutual labels:  twitter

account-activity-dashboard

Sample web app and helper scripts to get started with Twitter's premium Account Activity API (All Activities). Written in Node.js. Full documentation for this API can be found on the Account Activity API reference.

For the enterprise tier of the Account Activity API, please check out the Enterprise Account Activity Dashboard sample app.

Dependencies

Create and configure a Twitter app

  1. Create a Twitter app on Twitter Developer

  2. On the Permissions tab ➡️ Edit ➡️ Access permission section ➡️ enable Read, Write and direct messages.

  3. On the Keys and Tokens tab ➡️ Access token & access token secret section ➡️ click Create button.

  4. On the Keys and Tokens tab, take note of the consumer API key, consumer API secret, access token and access token secret.

Setup & run the Node.js web app

  1. Clone this repository:

    git clone https://github.com/twitterdev/account-activity-dashboard.git
    
  2. Install Node.js dependencies:

    npm install
    
  3. Pass your Twitter keys, tokens and webhook environment name as environment variables. Twitter keys and access tokens are found on your app page on your App Dashboard. The basic auth properties can be anything you want, and are used for simple password protection to access the configuration UI. As an alternative, instead of setting up env variables, you can copy the env.template file into a file named .env and and add these details there.

    TWITTER_CONSUMER_KEY= # your consumer key
    TWITTER_CONSUMER_SECRET= # your consimer secret
    TWITTER_ACCESS_TOKEN= # your access token
    TWITTER_ACCESS_TOKEN_SECRET= # your access token secret
    TWITTER_WEBHOOK_ENV= # the name of your environment as specified in your App environment on Twitter Developer
    BASIC_AUTH_USER= # your basic auth user
    BASIC_AUTH_PASSWORD= # your basic auth password
    
  4. Run locally:

    npm start
    
  5. Deploy app or setup a tunnel to localhost. To deploy to Heroku see "Deploy to Heroku" instructions below. To setup a tunnel use something like ngrok.

    Take note of your webhook URL. For example:

    https://your.app.domain/webhook/twitter
    
  6. Take note of the deployed URL, revisit your developer.twitter.com Apps Settings page, and add the following URL values as whitelisted Callback URLs:

    http(s)://your.app.domain/callbacks/addsub
    http(s)://your.app.domain/callbacks/removesub
    

Configure webhook to receive events

To configure your webhook you can use this apps' web UI, or use the example scripts from the command line.

Using the web UI

Load the web app in your browser and follow the instructions below.

  1. Setup webhook config. Navigate to the "manage webhook" view. Enter your webhook URL noted earlier and click "Create/Update."

  2. Add a user subscription. Navigate to the "manage subscriptions" view. Click "add" and proceed with Twitter sign-in. Once complete your webhook will start to receive account activity events for the user.

Using the command line example scripts

These scripts should be executed from root of the project folder. Your environment, url or webhook ID should be passed in as command line arguments.

  1. Create webhook config.

    node example_scripts/webhook_management/create-webhook-config.js -e <environment> -u <url>
    
  2. Add a user subscription for the user that owns the app.

    node example_scripts/subscription_management/add-subscription-app-owner.js -e <environment>
    
  3. To add a user subscription for another user using PIN-based Twitter sign-in.

    node example_scripts/subscription_management/add-subscription-other-user.js -e <environment>
    

Note: More example scripts can be found in the example_scripts directory to:

  • Create, delete, retrieve and validate webhook configs.
  • Add, remove, retrieve, count and list user subscriptions.

Deploy to Heroku (optional)

  1. Init Heroku app.

    heroku create
    
  2. Run locally.

    heroku local
    
  3. Configure environment variables for each See Heroku documentation on Configuration and Config Vars.

  4. Deploy to Heroku.

    git push heroku master
    

Note: The free tier of Heroku will put your app to sleep after 30 minutes. On cold start, you app will have very high latency which may result in a CRC failure that deactivates your webhook. To trigger a challenge response request and re-validate, run the following script.

node example_scripts/webhook_management/validate-webhook-config.js -e <environment> -i <webhook_id>

Production considerations

This app is for demonstration purposes only, and should not be used in production without further modifcations. Dependencies on databases, and other types of services are intentionally not within the scope of this sample app. Some considerations below:

  • With this basic application, user information is stored in server side sessions. This may not provide the best user experience or be the best solution for your use case, especially if you are adding more functionality.
  • The application can handle light usage, but you may experience API rate limit issues under heavier load. Consider storing data locally in a secure database, or caching requests.
  • To support multiple users (admins, team members, customers, etc), consider implementing a form of Access Control List for better security.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].