WIP repository for a ncurses fediverse/mastodon client, using python mastodon.py

fedicurses.py 521B

123456789101112131415161718192021222324252627
  1. import curses
  2. from html.parser import HTMLParser
  3. from mastodon import Mastodon
  4. class PostParser(HTMLParser):
  5. def handle_starttag(self, tag, attrs):
  6. print(tag)
  7. mastodon = Mastodon(
  8. access_token = 'd100.club_usercred.secret',
  9. api_base_url = 'd100.club'
  10. )
  11. print(mastodon.timeline()[0]["content"])
  12. def main(stdscr):
  13. stdscr.clear()
  14. curses.halfdelay(10)
  15. i = 'c'
  16. q = 0
  17. con = True
  18. while con:
  19. i = stdscr.getch()
  20. con = (i != ord('q'))
  21. #curses.wrapper(main)