Skip to content

Instantly share code, notes, and snippets.

View cmj's full-sized avatar
💭
📠

cmj cmj

💭
📠
View GitHub Profile
@cmj
cmj / test.sh
Created December 29, 2025 19:07
curl -sv 'https://api.x.com/graphql/Y86LQY7KMvxn5tu3hFTyPg/UserWithProfileTweetsAndRepliesQueryV2?variables=%7B%22includeTweetImpression%22%3Atrue%2C%22includeHasBirdwatchNotes%22%3Afalse%2C%22includeEditPerspective%22%3Afalse%2C%22includeEditControl%22%3Atrue%2C%22count%22%3A40%2C%22rest_id%22%3A%22783214%22%2C%22includeTweetVisibilityNudge%22%3Atrue%2C%22autoplay_enabled%22%3Atrue%7D&features=%7B%22longform_notetweets_inline_media_enabled%22%3Atrue%2C%22super_follow_badge_privacy_enabled%22%3Atrue%2C%22longform_notetweets_rich_text_read_enabled%22%3Atrue%2C%22super_follow_user_api_enabled%22%3Atrue%2C%22unified_cards_ad_metadata_container_dynamic_card_content_query_enabled%22%3Atrue%2C%22super_follow_tweet_api_enabled%22%3Atrue%2C%22articles_api_enabled%22%3Afalse%2C%22android_graphql_skip_api_media_color_palette%22%3Atrue%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22freedom_of_speech_not_reach_fetch_enabled%22%3Atrue%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22longfo
@cmj
cmj / search.sh
Last active December 28, 2025 23:30
Twitter rate-limit search test
#!/usr/bin/env bash
# Twitter rate-limit search test
# ./search.sh <auth_token>
auth_token=$1
x_csrf_token=$(openssl rand -hex 16)
query="fish"
product="Latest" # Latest | Top
count=1 # 1-20
@cmj
cmj / port
Created December 27, 2025 08:50
Show working directory of process listening on port number
#!/bin/bash
if [[ -z $1 ]]; then echo "$0 <port> # show cwd and process listening on port"; exit 1; fi
sudo lsof -w -a -p $(lsof -iTCP:$1 -sTCP:LISTEN | awk 'NR>1 {print $2}') -d cwd 2>/dev/null
count source
5472532 Twitter for iPhone
2352210 Twitter Web App
1675572 1910537532166836224gork
520489 Twitter for Android
323033 Banners & Ads
291193 TweetDeck Web App
55102 Twitter Web Client
51085 Twitter for iPad
@cmj
cmj / consts.nim
Last active December 12, 2025 10:26
Test Nitter with Mac oauth tokens
const
bearerToken* = "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
# android
#consumerKey* = "3nVuSoBZnx6U4vzUxf5w"
#consumerSecret* = "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys"
#bearerToken2* = "Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F"
# mac
consumerKey* = "3rJOl1ODzm9yZy63FACdg"
@cmj
cmj / e425ccc59fa7caa1e00346350f8da096a46599b1.patch
Created December 11, 2025 16:07
[PATCH] Add source to stats row
From e425ccc59fa7caa1e00346350f8da096a46599b1 Mon Sep 17 00:00:00 2001
From: cmj <129799+cmj@users.noreply.github.com>
Date: Thu, 11 Dec 2025 06:41:15 -0800
Subject: [PATCH] Add source to stats row
---
src/api.nim | 21 ++++++++++++---------
src/parser.nim | 6 +++++-
src/sass/tweet/_base.scss | 6 ++++++
src/types.nim | 1 +
@cmj
cmj / wx-precip.sh
Last active December 9, 2025 15:02
Latest 24 hour precip for station
#!/bin/bash
# grab total -24hour precip for a station
# ex: start=202512081428 end=202512091428
# ./wx-precip.sh KPDX
# Total precip at KPDX (24Hr): 2.271 inches
# Total precip at KSEA (24Hr): 1.163 inches
if [ -z "$1" ]; then
station=KSEA # KSEA KPDX C5053
@cmj
cmj / verify_credentials.sh
Created December 9, 2025 11:07
verify_credentials example
#!/bin/bash
# Test verify_credentials/isLoggedIn endpoint
usage() { echo "$0 <auth_token>"; exit 1; }; [ -z $1 ] && usage
#. ~/.env-twitter
x_csrf_token=00000000000000000000000000000000
auth_token=$1
bearer_token="AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F"
@cmj
cmj / down
Created December 5, 2025 15:42
Pretty print downdetector.com
#!/usr/bin/python3
import requests
import cloudscraper
from bs4 import BeautifulSoup
# use cloudscraper + stealth_mode, print company with
# outages reported within last hour or day (see below)
scraper = cloudscraper.create_scraper(
interpreter='js2py',
@cmj
cmj / 2025-11-29_10-23.svg
Created November 29, 2025 18:28
nitter with functioning x-client-transaction-id
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.