Skip to content

Instantly share code, notes, and snippets.

View cmj's full-sized avatar
💭
📠

cmj cmj

💭
📠
View GitHub Profile
@cmj
cmj / jf-search-irc.py
Created June 12, 2026 13:36
Focused on irc watch-mode
#!/usr/bin/env python3
"""
jf_search.py
---------------
Fetches and parses X (Twitter) search results from jf.x.com into structured JSON.
Usage:
python jf_search.py "python programming" --filter live
python jf_search.py "nasa" --filter top --pretty
python jf_search.py "gardening" --filter user -d
@cmj
cmj / twitter-cookie.sh
Created June 11, 2026 14:09
Changes to login flow have been made upstream, current testing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
From 5f6aef3a02ff2a3ea5e263691c1d010868993b4d Mon Sep 17 00:00:00 2001
From: cmj <129799+cmj@users.noreply.github.com>
Date: Mon, 11 May 2026 04:48:04 -0700
Subject: [PATCH] Fix for empty cards
---
src/parser.nim | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/parser.nim b/src/parser.nim
@cmj
cmj / guest-sorted-check.sh
Created May 3, 2026 14:36
Check if a Twitter timeline is sorted from guest views
#!/usr/bin/env bash
# Check if a timeline is sorted chronological or by "best of" as a guest
#screen_name="NWS_NTWC"
screen_name=$1
user_agent="TwitterAndroid/10.21.1"
bearer_token='AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'
#json_file="/tmp/${endpoint##*/}-$EPOCHSECONDS.json"
guest_token=$(curl -s -XPOST -H "Authorization: Bearer ${bearer_token}" "https://api.twitter.com/1.1/guest/activate.json" | jq -r '.guest_token')
@cmj
cmj / tw2rss-guest.py
Created April 25, 2026 11:32
Standalone Twitter guest RSS generator
#!/usr/bin/env python3
# Twitter guest - standalone RSS generator
# Works with some news/govt accounts, ex:
# NASA KIRO7Seattle AJEnglish cnn abc nbcnews ap NBCNewYork ABC7NY (AOC potus whitehouse etc)
import os
import time
import json
import random
@cmj
cmj / twitter-auth_token-session.py
Last active April 2, 2026 10:56
Interactive browser session
#!/usr/bin/env python3
# Load a Twitter session using auth_token
from selenium import webdriver
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
import sys
import os
@cmj
cmj / chuck.tcl
Created March 21, 2026 01:25
Random Chuck Norris joke
#!/usr/bin/env tclsh
# Random Chuck Norris joke, circa 2008
set chuck {
"Chuck Norris' tears cure cancer. Too bad he has never cried. Ever. "
"Chuck Norris does not sleep. He waits. "
"Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. "
"The chief export of Chuck Norris is pain. "
"If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death. "
"Chuck Norris has counted to infinity. Twice. "
@cmj
cmj / curl_format.sh
Created March 16, 2026 09:23
Format curl one-liners into multiple lines
#!/usr/bin/env bash
# Break out curl one-liners into multiple lines
if [[ $# -gt 0 ]]; then
cmdline="$*"
else
read -r cmdline
fi
eval "set -- $cmdline"