Code Monkey home page Code Monkey logo

fruitmachinebot's Introduction

Fruit Machine Mastodon Bot

Source code for the very silly bot deployed at @[email protected].

This codebase includes the Mastodon client and "Fruit Machine" image generator for the aforementioned bot.

Artwork

As configured, the fruit machine symbols are set to use the fabulous Mutant Standard, an alternative emoji set with great principles, and a highly readable and all around lovely design language.

If you like what you see, please support their work through donations or get yourself good merch from them.

Check the official website for the license of the emoji.

Mastodon Client

The Mastodon client is built for the purpose of this bot, using Mastodon.py (PyPI).

Operation

Requirements

  • Python 3.6.

Configuration

The bot's behaviour can be configured through data/resources.json.

Usage

Local usage

First you need to populate the resources/emoji/ directory with a structure of images as generated by orxporter. Check the directory's README for more details.

Then to generate a Fruit Machine locally:

$ ./bin/fruitmachine -o <path_for_image>

The standard output will show a status and image description.

Posting to Mastodon

To post to Mastodon, you need to set up the client by one of the following ways:

  1. Set the FRUITMACHINE_CLIENT_ID, FRUITMACHINE_CLIENT_SECRET and FRUITMACHINE_ACCESS_TOKEN environment variables with the values given on the Settings > Development > Your application interface of your Mastodon instance;
  2. Create a file named .ENV in the root directory of the project, with the same variables as above in the format variable_name=value, one per line.
  3. Create two text files, data/client_cred.secret and data/user_cred.secret. The first file should have the "Client ID" in the first line, and the "Client Secret" in second line; the second file needs to have the "Access Token" in the first line.

Then just use:

$ ./bin/fruitmachine

and a fruit machine will be posted to the account. You can use the -D switch to print "debug" data, and the post's visibility will be set to direct, i.e., only the account posting will be able to see it.

License

The code is licensed under an ISC license. Check LICENSE for details.

Check Mutant Standard's homepage for the emoji's license.

The Fruit Machine graphics are licensed under a Creative Commons LicenseCreative Commons Attribution 4.0 International License.

fruitmachinebot's People

Contributors

shello avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.