Coder Social home page Coder Social logo

dogpack's Introduction

another Google-owned dog pack

Dogpack

Dogpack is a Twitter bot which automates announcing and confirming meetups of DogpatchJS. It will:

  • Tweet announcing DogpatchJS the morning of the meetup
  • Accept RSVPs in the form of DMs containing emoji
  • Tweet a confirmation or cancellation of the event depending on how many RSVPs are received

Setup

Dogpack is hosted on Google Cloud Functions. To set up your own Dogpack:

  1. Create a new project on the Google Cloud Console.

  2. Create a new Twitter app key.

  3. Copy config.json.sample to config.json, and fill in:

    • project_id: Your Google Cloud project id
    • consumer_key: Your Twitter app "Consumer Key"
    • consumer_secret: Your Twitter app "Consumer Secret"
  4. Authenticate with Twitter:

    1. Run ./scripts/setupTwitter.js and open http://localhost:3000 in a web browser.

    2. Click the link and authorize your Twitter app.

    3. Copy the values of access_token_key, access_token_secret, and twitter_id into your config.json.

    4. Note the value of "Suggested webhook name" for the following step.

      The webhook name should be a long random string (which is difficult to guess). We rely on obscurity to prevent unauthorized calls to the webhook endpoint because of a shortcoming in GCF which prevents checking request signatures.

  5. Deploy on GCF:

    1. Create a Google Cloud Storage bucket for staging your functions.
    2. Run BUCKET=your-storage-bucket-name HOOKNAME=your-webhook-name ./scripts/setupFunctions.sh
    3. Note the HTTPs trigger endpoint URL for your webhook in the output. It might be of the form: https://region-projectname.cloudfunctions.net/your-webhook-name. Use this in the following step.
  6. Set up Twitter's DM Webhook: run ./scripts/setupWebhook.js your-webhook-https-url

    You should now have a functioning bot! Test it out by triggering the "postEvent" and "postRSVPs" functions in the Cloud Functions console, or by sending it a Twitter DM.

  7. Set up scheduled posting:

    1. Customize cron.yaml.sample to suit your meetup schedule.

    2. Clone this Google example repo and follow the deployment instructions, adding your cron.yaml.

      Refer to this PR (if it hasn't been merged yet) for securing your App Engine deployment.

dogpack's People

Contributors

chromakode avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.