Skip to content

Instantly share code, notes, and snippets.

Avatar

Jackson Palmer ummjackson

View GitHub Profile
@ummjackson
ummjackson / Peach v1 API Endpoints.md
Last active September 16, 2019 08:18
Peach v1 API Endpoints
View Peach v1 API Endpoints.md

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 / social-requirements.md
Created November 8, 2016 05:21
Brainstorming about what Twitter could be... 🤔
View social-requirements.md

This is a WIP

Basics

  • 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)
@ummjackson
ummjackson / chime-backup.md
Created April 7, 2017 00:58
chime.social data backup, prior to closure of instance.
View chime-backup.md

🔔 chime.social backup

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

@ummjackson
ummjackson / killabot.py
Created May 4, 2018 08:05
killabot v1 (wip)
View killabot.py
# 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
View awdy-bitcoin.py
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 / xrpaway.py
Last active November 24, 2022 06:36
XRP Away™️ - automatically block XRP fanatics sliding into your Twitter mentions
View xrpaway.py
# 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
View audio-spectrum.sh
#!/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
@ummjackson
ummjackson / MASTO-FTS.MD
Last active January 4, 2023 01:03
Run full-text search SQL on a Mastodon federated stream
View MASTO-FTS.MD

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 / mastodon-emojified-content.js
Created January 8, 2023 08:16
JavaScript function to convert Mastodon custom emoji shortcodes into HTML image tags
View mastodon-emojified-content.js
/*
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 / fedistream.html
Last active January 24, 2023 23:50
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.
View fedistream.html
<!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,