Skip to content

Instantly share code, notes, and snippets.

View ummjackson's full-sized avatar

Jackson Palmer ummjackson

View GitHub Profile
ummjackson / timeline.json
Created January 18, 2023 05:07
why is this breaking some mastodon clients?
"id": "1615562828584480769",
"created_at": "2023-01-18T04:12:48.000Z",
"in_reply_to_id": 1615554007954587600,
"in_reply_to_account_id": 75586944,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": "en",
"uri": "",
ummjackson / fedistream.html
Last active January 25, 2024 16:20
fedistream - filter the Mastodon firehose with a single HTML file (work in progress!). Instructions: download the .zip, extract it and double-click the "fedistream.html" file to get started.
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
body {
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
ummjackson / mastodon-emojified-content.js
Created January 8, 2023 08:16
JavaScript function to convert Mastodon custom emoji shortcodes into HTML image tags
This JavaScript function takes "content" value and "emojis" array from a Mastodon API "status" object and converts custom emoji shortcodes into the corresponding HTML image tags.
Example usage, assuming you have just parsed a JSON "status" object from the Mastodon API into a "status" variable:
emojifiedContent = customEmojis(status.content, status.emojis);
You will then want to use CSS to style the ".emoji" class. Example CSS:
.emoji {
ummjackson / MASTO-FTS.MD
Last active January 4, 2023 01:03
Run full-text search SQL on a Mastodon federated stream

Mastodon Streaming Full-Text Search

This is a (hacky) implementation of full-text search in Python for Mastodon. Built and tested with Python 3.10

Errors and disconnections are not handled, so you'll need to implement that for something more robust and production ready. If you just want to monitor certain keywords via SQL queries from a real-time stream, however, the simple implementation may suit your needs.

You can change the instance URL on Line 28 (default: to fetch the federated timeline from somehwere else, if you'd like. Big, well-federated instances will obviously expose the most rich streams.


ummjackson /
Created July 13, 2022 06:26
FFmpeg Audio Spectrum
# Make sure you have ffmpeg installed (eg. brew install ffmpeg)
ffmpeg -i "your-audio-file.wav" -filter_complex "asplit[main][tmp]; [tmp]aformat=channel_layouts=mono,aresample=32000 [cut]; [cut]showfreqs=mode=bar:ascale=sqrt:win_size=2048:s=1920x240:colors=White[out]; [out]split[top][bottom]; [bottom]vflip[bottom]; [top][bottom]vstack=inputs=2[combined]" -map "[combined]" -pix_fmt yuv420p -map "[main]" -preset ultrafast output.mp4
ummjackson /
Last active November 24, 2022 06:36
XRP Away™️ - automatically block XRP fanatics sliding into your Twitter mentions
# Requirement: pip install tweepy
import tweepy
# Credentials go here (generate at:
auth = tweepy.OAuthHandler('consumer_key', 'consumer_secret')
auth.set_access_token('access_token', 'access_token_secret')
# Connect to Twitter
api = tweepy.API(auth)
import time
import pandas as pd
from selenium import webdriver
# These are the variables which must be calculated by the script.
consensus_distribution = None
wealth_distribution = None
client_codebases = None
public_nodes_source = None
ummjackson /
Created May 4, 2018 08:05
killabot v1 (wip)
# Requirements: pip install tweepy fuzzywuzzy python-Levenshtein
import tweepy
import re
from fuzzywuzzy import fuzz
# Credentials go here (generate at:
auth = tweepy.OAuthHandler('consumer_key', 'consumer_secret')
auth.set_access_token('access_token', 'access_token_secret')
# Connect to Twitter
ummjackson /
Created April 7, 2017 00:58 data backup, prior to closure of instance.

🔔 backup

this is a backup of tables containing non-private/sensitive data from, prior to the closure of the instance.

ummjackson /
Created November 8, 2016 05:21
Brainstorming about what Twitter could be... 🤔

This is a WIP


  • Implement core feature set of Twitter (users, statuses, followers/friends, lists, blocking)
  • Do not implement direct messaging initially (there are already any IM clients out there)
  • Implement 1:1 replica of Twitter v1.1 API
    • Very generous limits up-front (only what's needed to avoid denial of service / spam attacks)
    • Clients must register a Client ID prior to making requests (same as Twitter)