From b13892188634514caae361b9090ffbec6ff5087c Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 9 May 2022 17:35:25 -0400 Subject: [PATCH] add user signature --- .gitignore | 1 + requirements.txt | 3 +++ toot | 12 ++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index cb6431e..37eb00c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ toot.json +venv/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f38ddb9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Mastodon.py==1.5.1 +emoji~=1.6.3 +click==8.1.3 diff --git a/toot b/toot index bd0e0c0..341cf59 100755 --- a/toot +++ b/toot @@ -1,10 +1,10 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +import click +import emoji +import getpass import json import os import sys - -import click -import emoji from mastodon import Mastodon @click.command() @@ -31,12 +31,12 @@ def toot(status, creds): status = emoji.emojize(status, use_aliases=True) # check status length and post status - if len(status) > 500: + if len(status) > 5000: print("Status is too long, try again") elif len(status) == 0: print("Did you type a status?") else: - print(mastodon.toot(status)["uri"]) + print(mastodon.toot(f"{status}\n~{getpass.getuser()}")["uri"]) if __name__=='__main__': toot()