Added some things to help other people run this

This commit is contained in:
gamemake-eng 2023-12-09 20:59:22 -06:00
parent 280709b0f7
commit 19acfbf013
3 changed files with 44 additions and 30 deletions

View File

@ -1 +1,6 @@
# Mastoline
## How to run
`sh install.sh`
`python3 main.py`

4
install.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
pip install html2text
pip install Mastodon.py
pip install rich

65
main.py
View File

@ -91,35 +91,40 @@ print(art)
print("[bold pink]Ver "+ver+"[/] "+codename)
print("Welcome to [bold cyan]MastoLine![/] Mastodon in your terminal!")
print("------------------------------------")
while (True):
user = mastodon.me()
cmd = input(user.acct+" ~> ")
def main():
while (True):
user = mastodon.me()
cmd = input(user.acct+" ~> ")
if (cmd == "list") or (cmd == "l"):
listposts()
elif (cmd == "refresh") or (cmd == "f"):
refresh()
elif (cmd == "reply") or (cmd == "r"):
reply()
elif (cmd == "toot") or (cmd == "t"):
poststatus()
elif (cmd == "help") or (cmd == "h"):
print("NOTE: none of these commands have arguments")
print("[bold cyan]#[/] - view post of id")
print("[bold cyan]list/l[/] - lists the user's timeline with it's id next to it")
print("[bold cyan]refresh/f[/] - refreshes the timeline")
print("[bold cyan]reply/r[/] - replies to a post from reply id")
print("[bold cyan]toot/t[/] - posts a status on mastodon")
print("[bold cyan]exit/e[/] - exit out of MastoLine")
print("[bold cyan]about/a[/] - find into about Mastoline")
elif (cmd == "exit") or (cmd == "e"):
exit()
elif (cmd == "about") or (cmd == "a"):
print(art)
print("[bold pink]Ver "+ver+"[/] "+codename)
else:
if cmd.isnumeric() and int(cmd) < 40:
post = posts[int(cmd)]
view(post)
if (cmd == "list") or (cmd == "l"):
listposts()
elif (cmd == "refresh") or (cmd == "f"):
refresh()
elif (cmd == "reply") or (cmd == "r"):
reply()
elif (cmd == "toot") or (cmd == "t"):
poststatus()
elif (cmd == "help") or (cmd == "h"):
print("NOTE: none of these commands have arguments")
print("[bold cyan]#[/] - view post of id")
print("[bold cyan]list/l[/] - lists the user's timeline with it's id next to it")
print("[bold cyan]refresh/f[/] - refreshes the timeline")
print("[bold cyan]reply/r[/] - replies to a post from reply id")
print("[bold cyan]toot/t[/] - posts a status on mastodon")
print("[bold cyan]exit/e[/] - exit out of MastoLine")
print("[bold cyan]about/a[/] - find into about Mastoline")
elif (cmd == "exit") or (cmd == "e"):
exit()
elif (cmd == "about") or (cmd == "a"):
print(art)
print("[bold pink]Ver "+ver+"[/] "+codename)
else:
print("It's not existing :star:")
if cmd.isnumeric() and int(cmd) < 40:
post = posts[int(cmd)]
view(post)
else:
print("It's not existing :star:")
if __name__ == "__main__":
main()