Skip to content

Instantly share code, notes, and snippets.

View cmj's full-sized avatar
💭
📠

cmj cmj

💭
📠
View GitHub Profile
@cmj
cmj / get-previous-username.sh
Created January 31, 2026 13:49
Find the last username change
#!/bin/bash
# requires auth_token.
#auth_token=""
source ~/.env-twitter
screen_name=$1
usage() { echo -e "Show Twitter account location (requires auth_token)\n $0 <screen_name>"; exit 1; }
[[ ! "$auth_token" || ! "$screen_name" ]] && usage
@cmj
cmj / get_session.py
Last active January 29, 2026 11:34
Nitter get_session script
#!/usr/bin/env python3
import requests
import json
import sys
import pyotp
import cloudscraper
# NOTE: pyotp, requests and cloudscraper are dependencies
# > pip install pyotp requests cloudscraper
@cmj
cmj / twikit-guestclient.py
Created January 27, 2026 10:15
twikit GuestClient example
import asyncio
from twikit.guest import GuestClient
client = GuestClient()
#client = GuestClient(proxy='http://127.0.0.1:8888')
async def main():
# Activate the client by generating a guest token.
guest_token = await client.activate()
@cmj
cmj / GuestClient.md
Created January 25, 2026 19:59
twikit guest client update

@cmj
cmj / twikit-tweet.py
Created January 24, 2026 11:04
basic twikit tweet test
#!/usr/bin/env python3
import asyncio
from twikit import Client
client = Client()
# charles proxy
#client = Client(proxy='http://127.0.0.1:8888')
client.load_cookies('cookies.json')
async def tweet():
@cmj
cmj / example.md
Last active January 2, 2026 05:48
Nitter - 2 bearerTokens, 1 cookie

Randomized use of iPhone and Android bearer tokens for API results in increased rate-limits.
Both tokens show x-rate-limit-remaining of 147

> $ endpoints.sh $AUTH_TOKEN # Using Android bearerToken
1) -oaLodhGbbnzJBACb1kk2Q/UserByScreenName 8) q94uRCEn65LZThakYcPT6g/TweetDetail 15) BbGLL1ZfMibdFNWlk7a0Pw/ListTimeline
2) u7wQyGi6oExe8_TRWGMq4Q/UserResultByScreenNameQuery 9) 7xflPyRiUxGVbJd4uWmbfg/TweetResultByRestId 16) oRJs8SLCRNRbQzuZG93_oA/UserTweets
3) oPppcargziU1uDQHAUmH-A/UserResultByIdQuery 10) nzme9KiYhfIOrrLrPP_XeQ/TweetResultByIdQuery 17) kkaJ0Mf34PZVarrxzLihjg/UserTweetsAndReplies
4) 3JNH4e9dq1BifLxAa3UMWg/UserWithProfileTweetsQueryV2 11) gkjsKepM6gl_HmFWoWKfgg/SearchTimeline 18) Y4Erk_-0hObvLpz0Iw3bzA/ConversationTimeline
5) 8IS8MaO-2EN6GZZZb8jF0g/UserWithProfileTweetsAndRepliesQueryV2 12) iTpgCtbdxrsJfyx0cFjHqg/ListByRestId 19) wfglZEC0MRgBdxMa_1a5YQ/Retweeters
6) 36oKqyQ7E_9CmtONGjJRsA/UserMedia 13) -kmqNvm5Y-cVrfvBy6docg/ListBySlug
7) PDfFf8hGeJvUCiTyWtw4wQ/MediaTimelineV2 14) P4NpVZDqUD_7MEM84L-8nw/ListMembers
Choose endpoint ('enter' for list, ^C to quit): 1
{"data":{"use
@cmj
cmj / search.sh
Last active December 29, 2025 22:54
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