Skip to content

Instantly share code, notes, and snippets.

View ummjackson's full-sized avatar

Jackson Palmer ummjackson

View GitHub Profile
@ummjackson
ummjackson / Peach v1 API Endpoints.md
Last active February 8, 2024 18:27
Peach v1 API Endpoints

Peach (peach.cool) API Endpoints

Peach is hot right now so I poked around their API using https://mitmproxy.org/

As of the last update, this seems to be a fairly extensive/complete list of v1 endpoints, but feel free to submit revisions to this gist with any others you find!

Login

@ummjackson
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>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>fedistream</title>
<style>
html,
body {
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
@ummjackson
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": "https://twitter.com/karl_delo/status/1615562828584480769",
@ummjackson
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
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: mastodon.social) to fetch the federated timeline from somehwere else, if you'd like. Big, well-federated instances will obviously expose the most rich streams.

Running

@ummjackson
ummjackson / killabot.py
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: https://apps.twitter.com)
auth = tweepy.OAuthHandler('consumer_key', 'consumer_secret')
auth.set_access_token('access_token', 'access_token_secret')
# Connect to Twitter
@ummjackson
ummjackson / xrpaway.py
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: https://apps.twitter.com)
auth = tweepy.OAuthHandler('consumer_key', 'consumer_secret')
auth.set_access_token('access_token', 'access_token_secret')
# Connect to Twitter
api = tweepy.API(auth)
@ummjackson
ummjackson / audio-spectrum.sh
Created July 13, 2022 06:26
FFmpeg Audio Spectrum
#!/bin/sh
# 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
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
ummjackson / chime-backup.md
Created April 7, 2017 00:58
chime.social data backup, prior to closure of instance.

🔔 chime.social backup

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