Skip to content

Instantly share code, notes, and snippets.

@MystPi
Last active July 24, 2021 23:09
Show Gist options
  • Select an option

  • Save MystPi/8fa512ba69cf9fb502fdf747f9048710 to your computer and use it in GitHub Desktop.

Select an option

Save MystPi/8fa512ba69cf9fb502fdf747f9048710 to your computer and use it in GitHub Desktop.
Prints out your recent Scratch messages. You will have to provide your Scratch username and password.
from scratchclient import ScratchSession
import re
session = ScratchSession("your_username", "your_password")
ms = session.get_messages()
for m in ms:
if m.type == "addcomment":
frag = re.sub(r"\&\#39;", "'", m.comment_fragment)
frag = re.sub(r"\"", '"', frag)
print(f"({m.actor}) " + frag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment