Un bot qui récupère une image random en local et la publie
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
475B

  1. from html.parser import HTMLParser
  2. class TootHTMLParser(HTMLParser):
  3. def __init__(self):
  4. super().__init__()
  5. self.txt = ""
  6. def handle_data(self, data):
  7. self.txt += str(data).lstrip().rstrip().lower() + " "
  8. #
  9. #
  10. # content = ""
  11. # with open("input") as f:
  12. # content = f.readlines()
  13. # content = set(content)
  14. # parser = TootHTMLParser()
  15. # for word in content:
  16. # parser.feed(word)
  17. # with open("output", "w+") as f:
  18. # f.write(parser.txt)