• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

shello/fruitmachinebot: Source code for a silly Mastodon bot:

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

shello/fruitmachinebot

开源软件地址(OpenSource Url):

https://github.com/shello/fruitmachinebot

开源编程语言(OpenSource Language):

Python 97.8%

开源软件介绍(OpenSource 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 two 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 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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap