An updated bot that posts to Tumblr, based on your very own blog!
Project description
tumblrbot
Description of original project:
4tv-tumblrbot was a collaborative project I embarked on with my close friend Dima, who goes by @smoqueen on Tumblr. The aim of this endeavor was straightforward yet silly: to develop a Tumblr bot powered by a machine-learning model. This bot would be specifically trained on the content from a particular Tumblr blog or a selected set of blogs, allowing it to mimic the style, tone, and thematic essence of the original posts.
This fork is largely a rewrite of the source code with similarities in its structure and process.
Features:
- An interactive console for all steps of generating posts for the blog:
- Asks for OpenAI and Tumblr tokens.
- Stores API tokens using keyring.
- Prevents API tokens from printing to the console.
- Retrieves Tumblr OAuth tokens.
- Downloads posts from the configured Tumblr blogs.
- Skips redownloading already downloaded posts.
- Shows progress and previews the current post.
- Creates examples to fine-tune the model from your posts.
- Filters out posts that contain more than just text data.
- Filters out any posts flagged by the OpenAI Moderation API (optional).
- Shows progress and previews the current post.
- Formats asks as the user message and the responses as the assistant response.
- Adds custom user messages and assistant responses to the dataset from the configured file.
- Provides cost estimates if the currently saved examples are used to fine-tune the configured model.
- Uploads examples to OpenAI and begins the fine-tuning process.
- Resumes monitoring the same fine-tuning process when restarted.
- Stores the output model automatically when fine-tuning is completed.
- Generates and uploads posts to the configured Tumblr blog using the configured fine-tuned model.
- Creates tags by extracting keywords at the configured frequency using the configured model.
- Uploads posts as drafts to the configured Tumblr blog.
- Shows progress and previews the current post.
- Asks for OpenAI and Tumblr tokens.
- Colorful output, progress bars, and post previews using rich.
- Automatically keeps the config file up-to-date and recreates it if missing.
To-Do:
- Add documentation.
- Finish updating README.md.
Please submit an issue or contact us for features you want added/reimplemented.
Installation
- Install the latest version of Python:
- Windows:
winget install python3 - Linux (apt):
apt install python-pip - Linux (pacman):
pacman install python-pip
- Windows:
- Install the pip package:
pip install tumblrbot- Alternatively, you can install from this repository:
pip install git+https://github.com/MaidThatPrograms/tumblrbot.git - On Linux, you will have to make a virtual environment.
- Alternatively, you can install from this repository:
Usage
Run tumblrbot from anywhere. Run tumblrbot --help for command-line options. Every command-line option corresponds to a value from the config.
Obtaining Tokens
- The OpenAI API token can be created here.
- Leave everything at the defaults and set
ProjecttoDefault Project. - Press
Create secret key. - Press
Copyto copy the API token to your clipboard.
- Leave everything at the defaults and set
- The Tumblr API tokens can be created here.
- Press
+ Register Application. - Enter anything for
Application NameandApplication Description. - Enter any URL for
Application WebsiteandDefault callback URL, likehttps://example.com. - Enter any email address for
Administrative contact email. It probably doesn't need to be one you have access to. - Press the checkbox next to
I'm not a robotand complete the CAPTCHA. - Press
Register. - You now have access to your
consumer keynext toOauth Consumer Key. - Press
Show secret keyto see yourConsumer Secret.
- Press
When running this program, you will be prompted to enter all of these tokens. The fields are password-protected, so there will be no output to the console. If something goes wrong while entering the tokens, you can always reset them by running the program again and answering y to the relevant prompt.
After inputting the Tumblr tokens, you will be given a URL that you need to open in your browser. Press Allow, then copy and paste the URL of the page you are redirected to into the console.
Configuration
All config options can be found in config.toml after running the program once. This will be kept up-to-date if there are changes to the config's format in a future update. This also means it may be worthwhile to double-check the config file after an update. Any changes to the config should be in the changelog for a given version.
WIP: There will be more information about the config options soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tumblrbot-1.3.1.tar.gz.
File metadata
- Download URL: tumblrbot-1.3.1.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64598a540da1c49d551ac7379b646d329d1cdbab7da6266987f6c8bf10e65634
|
|
| MD5 |
407decdf0ff1147f0f6159d0eb6e8319
|
|
| BLAKE2b-256 |
fb92274bf5c7a092a87e190f127a77743aee5f0becc5d4ab6682204f05138602
|
File details
Details for the file tumblrbot-1.3.1-py3-none-any.whl.
File metadata
- Download URL: tumblrbot-1.3.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea920bbea0727457b86555816a104cca25bd0426ccac9ebb2f0c930ba782f433
|
|
| MD5 |
0412f4c926b083e4e5ac3a1167cd44e3
|
|
| BLAKE2b-256 |
149140f4ddf4312274cc6d213bdecc424ca5ba5f232d2f7158d071dcf56598a0
|