Giter Club home page Giter Club logo

twitter-echo-bot's Introduction

Build and Publish Go Report Card CircleCI codecov

Twitter echo bot

This is a very simple application, a proof of concept as working code written in Golang, that access Twitter API to send an answer in the name of the account owner for those tweets that matches the query pattern.

Example

See it on Twitter.

Automated response

Docker image

The Docker image is hosted at Docker Hub and it is build and pushed through GitHub Actions.

Docker repository

How to build it

$ docker build -t twitter-echo-bot .

How to execute it

$ docker run -p 8080:8080 \
    -e CONSUMER_API_KEY="key" \
    -e CONSUMER_API_SECRET="secret" \
    -e ACCESS_TOKEN="token" \
    -e ACCESS_TOKEN_SECRET="token_secret" \
    -e SEARCH_QUERY="#ariel17echobot" \
    -e GREET_TEXT="Hellou!" \
    -e RESPONSE_TEXT="bip bop bip!" \
    -e JOB_SECONDS=10 \
    twitter-echo-bot

Using an .env is preferred, also the deployment process uses it to provide the required settings to the application instead of setting raw environment variables. Watch out to not track it!

$ docker run --env-file=.env twitter-echo-bot

Using make commands

This project includes a Makefile to avoid writting all those commands by hand and go directly to the point with the same results:

$ make build  # to test and build the image with :dev tag

$ make run  # builds AND executes the application in your terminal

Production deployment

The deployment is made using Terraform to a AWS t2.nano instance. The execution plan works as follows:

Execution plan

⚠️ This configuration uses SSH to provision the Docker service, to pull and execute the image; it may not be the most secure option for you.

Development lifecycle

Services integration diagram

twitter-echo-bot's People

Contributors

ariel17 avatar

Watchers

 avatar  avatar  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.