Skip to content

Instantly share code, notes, and snippets.

import requests
from flask import Flask, request
app = Flask(__name__)
@app.route('/casts/<cast_id>')
def show_cast(cast_id):
# Use the requests library to make a GET request to the external API
# with the bearer token in the Authorization header
response = requests.get(
@danromero
danromero / token.js
Last active September 26, 2024 00:25
Generate an Application Bearer Token from a Farcaster custody address mnemonic for Merkle v2 API
const ethers = require('ethers');
const canonicalize = require('canonicalize');
const https = require('https');
const myMnemonic = 'a b c d e f g h i j k';
async function run() {
// WARNING: Example only -- do not ever hard-code your real mnemonic!
wallet = ethers.Wallet.fromMnemonic(myMnemonic);
@danromero
danromero / twitter_dm.scpt
Created February 28, 2023 01:54
Delete Twitter DMs in your message request queue
repeat 10 times
tell application "Google Chrome" to tell active tab of window 1
execute javascript "document.querySelector('div[role=\"button\"][aria-label=\"Options menu\"]').click();"
delay 1
execute javascript "document.querySelector('div[role=\"menuitem\"]').click();"
end tell
end repeat
@danromero
danromero / hn_fc_bot.py
Created April 18, 2023 20:00
ChatGPT created script to auto post top Hacker News stories to Farcaster ever 10 minutes
import requests
import time
# Define the Hacker News API endpoint for top stories
hn_api_url = "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
# Define the Warpcast API endpoint for sending new casts
warpcast_api_url = "https://api.warpcast.com/v2/casts"
# Define the bearer token for the Warpcast API
0x00180e6fd17851a31ab96d2d07bb1b09980000d2d0ae5aeba1c6677236798777
0x00591bd4bb872ea30cfc19a37e1d36d0f8dceee963a68bac18954c9737f03c2c
0x005929140844397c4b0a7ea73f5df45258577b14a00eff222b0fd3e9b2bb1821
0x005929140844397c4b0a7ea73f5df45258577b14a00eff222b0fd3e9b2bb1821
0x005accae1d9e6acfceef792a2a8fc3b185da2d599d7f71dd20970c9c9b1e4408
0x0064a6025901eea37711934a6f4d69237d6d1eb5740ba71950cfe5c93a5e426e
0x009fc71100d4d2b2cf4fdcfe98f8887eadb0de2493f327ee32263866dd5cc36d
0x00ceab4beafa6e1f735edaec4aa905f53a0d30177eaa93d4210617c52a5afb65
0x00d43e9f1b5f41929f3b836101e112038109bc6658a83e7c7b53e65ad1ba042f
0x00df460a866850e7be017f1f3d8833205ee4b9855889b65b02ce7e4988d21d51
repeat 10 times
tell application "Google Chrome" to tell active tab of window 1
-- Click the "More" button
execute javascript "document.querySelector('div[role=\"button\"][aria-label=\"More\"]').click();"
delay 0.1
-- Click the "Delete conversation" button
execute javascript "Array.from(document.querySelectorAll('div[role=\"menuitem\"]')).find(el => el.innerText.includes('Delete conversation')).click();"
delay 0.1 -- You might need to adjust this delay based on the page's behavior
28d7042fc47562efd1acd1f986dd418b7bea6e2a83fb3c4d29603b470863031d