From 7dd9aabfc9d830f89f52291a9eadd16629e89046 Mon Sep 17 00:00:00 2001 From: dotnet Date: Tue, 10 Oct 2023 14:30:38 -0400 Subject: [PATCH] Add Readme and .gitignore --- .gitignore | 3 +++ README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46938ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +config.json +defaults.json +*.jpg \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ba41db --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# Gelbooru Image Bot for Misskey + +Simple python bot which scrapes images from gelbooru based on specified tags every hour and posts to a misskey instance. The script can handle multiple bots simulatenously. + +- Uses a systemd timer. +- Posts original source when available. +- Attempts to optimize downloaded images for size with PIL. +- Attempts to renote the original source if possible. +- Option for posting to hashtags (limits to once per day to avoid drowning out other content). + +## Usage + +```bash +python .\gelbooru_poster.py --help +Usage: python3 gelbooru-bot.py [--gen-config] [--help] + --gen-config: Add a new bot to the config.json file + --help: Show this help message + No arguments: Run the bot + Note: The values in defaults.json will be used if the values are not set in config.json +``` + +## Files +### config.json + +```json +{ + "hololive_images": { + "gelbooru_tags": "hololive", + "gelbooru_tags_exclude": "-sky", + "bot_message": "Hololive Image", + "bot_hashtags": "#hololive", + "misskey_token": "uuuu0hOhrrrlrlrP8888uquqaaaaAUAU", + "max_page_number": 200, + "last_run_time": -1 + }, + "kancolle": { + "gelbooru_tags": "kantai_collection", + "gelbooru_tags_exclude": "", + "bot_message": ".", + "bot_hashtags": "#kancolle", + "misskey_token": "HHkkuuuutdtdrrrrvWvW8888yayaaaaa", + "max_page_number": 200, + "last_run_time": 1696896202.1551812 + } +} +``` + + +### defaults.json + +```json +{ + "gelbooru_tags": "rating:safe", + "gelbooru_tags_exclude": "", + "bot_message": "Random image from Gelbooru", + "misskey_url": "https://misskey.io/api/", + "misskey_token": "", + "max_page_number": 1000 +} +```