Skip to content

Instantly share code, notes, and snippets.

View dansanderson's full-sized avatar

Dan Sanderson dansanderson

View GitHub Profile
@dansanderson
dansanderson / p8_devterm_printwatcher.py
Last active June 11, 2022 23:38
Prints .lua.png files exported from PICO-8 on a DevTerm
# The PICO-8 text printer for the ClockworkPi DevTerm!
#
# This Python script allows you to print text directly from the PICO-8 source
# code editor. The script runs in the background and watches for you to execute
# the "EXPORT FILE.LUA.PNG" command. It does some light processing of the
# generated image file, then sends it to DevTerm's thermal printer.
#
# This is mostly just a joke/hack for the purposes of this tweet:
# https://twitter.com/dan_sanderson/status/1434253649266364417?s=20
#
#!/usr/bin/env python3
"""
THIS SCRIPT DELETES YOUR TWEETS FROM TWITTER. Be careful! You are solely responsible for any
unintentionally lost data!
Specifically, this reads tweets from a personal data export, then deletes them from Twitter. As written,
this script deletes 1,000 tweets at a time, writing to a log file so it can start where it left off when
you run it again. This is just how I felt comfortable doing it, deleting in batches and eventually
deleting my entire Twitter history and preserve the local export data. Edit to your taste.
#!/usr/bin/env python3
import datetime
import os
import re
import time
import urllib.request
CPOSTS_RE = re.compile(r'"(/bbs/cposts/.*\.p8(.png)?)"')
SLEEP_SECS = 1