Giter VIP home page Giter VIP logo

seinbot-rs's Introduction

seinbot-rs

Crates.io twitter

A seinfeld twitter bot using aws lambda functions and markov chains in rust.

Introduction

tweet-example

Example tweet from frank costanza

I've always wanted to make a robot that contributes to the heat death of the universe through asinine tweets. This is the result!

Primarily for learning purposes, the intent of this project was to see how easy it would be to:

  1. Use markov chains to generate pseudo random text based on the hit TV series Seinfeld.
  2. Publish generated content to the internet.
  3. Automate content generation and publishing so it would occur on a daily basis.
  4. ... and do it all in Rust!

Results

Thankfully, there were a number of well-documented Rust libraries that made implemention of this project quite simple. Using AWS Lambda functions and the serverless application framework for Rust, it was trivial to deploy and configure the code to run periodically:

service: daily-tweet
provider:
  name: aws
  runtime: rust
...
functions:
  seinbot:
    handler: seinbot-rs
    events:
      - schedule: rate(24 hours)

Snippet from serverless.yml (used to deploy to AWS)

Whilst the bot mostly produces nonsensical output, it can sometimes construct something quite amusing (see above tweet). Overall, I am quite happy with final product and would like to thank the following projects that made it so:

  • seinfeld-scripts: For providing the database of seinfeld content used in the markov chain.
  • markov: For providing a Rust implementation of markov chains.
  • egg_mode: For providing the library used to interact with Twitter's API.
  • aws-lambda-rust-runtime: For providing the library used to implement an AWS Lambda function in Rust.
  • serverless-rust: For providing the framework used to configure, test, and deploy the bot.

seinbot-rs's People

Contributors

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