Skip to content

Instantly share code, notes, and snippets.

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
0x00180e6fd17851a31ab96d2d07bb1b09980000d2d0ae5aeba1c6677236798777
0x00591bd4bb872ea30cfc19a37e1d36d0f8dceee963a68bac18954c9737f03c2c
0x005929140844397c4b0a7ea73f5df45258577b14a00eff222b0fd3e9b2bb1821
0x005929140844397c4b0a7ea73f5df45258577b14a00eff222b0fd3e9b2bb1821
0x005accae1d9e6acfceef792a2a8fc3b185da2d599d7f71dd20970c9c9b1e4408
0x0064a6025901eea37711934a6f4d69237d6d1eb5740ba71950cfe5c93a5e426e
0x009fc71100d4d2b2cf4fdcfe98f8887eadb0de2493f327ee32263866dd5cc36d
0x00ceab4beafa6e1f735edaec4aa905f53a0d30177eaa93d4210617c52a5afb65
0x00d43e9f1b5f41929f3b836101e112038109bc6658a83e7c7b53e65ad1ba042f
0x00df460a866850e7be017f1f3d8833205ee4b9855889b65b02ce7e4988d21d51
@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
@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 / token.js
Last active October 19, 2023 19:21
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);
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(
[{"body":{"type":"text-short","publishedAt":1621010885463,"sequence":3,"username":"stallman","address":"0x68c6b1CEa2D655435f3Cf36E6b9F27Af9B31D518","data":{"text":"I did write some code in Java once, but that was the island in Indonesia."},"prevMerkleRoot":"0xe176d2cb262a5e379b7865ec60ba87f4b59710b1560fe32b29672bd12c77c2d7"},"merkleRoot":"0x23c0ad7f2fbae0db3c699b82007a2f3b19ffbe8e99daa5d3ea558c0d18806114","signature":"0x9c2db3dc1f09459147abbb5a686f812c80810d3c46d0078f43b2b7fe9512cdd31e9869f7a75257bf8c15c46b1d473cfec751ca28c8a8ecc2006d7ef11d63f6f61b"},{"body":{"type":"text-short","publishedAt":1621010874991,"sequence":2,"username":"stallman","address":"0x68c6b1CEa2D655435f3Cf36E6b9F27Af9B31D518","data":{"text":"No person, no idea, and no religion deserves to be illegal to insult, not even the Church of Emacs."},"prevMerkleRoot":"0x0e3d4cd0cf749c904ccd393d1d2a13661d428fb2095449760132429a2398e2e6"},"merkleRoot":"0xe176d2cb262a5e379b7865ec60ba87f4b59710b1560fe32b29672bd12c77c2d7","signature":"0xda1eee4d428b15475c
@danromero
danromero / unlike.py
Created July 14, 2020 18:07
Twitter unlike script
import tweepy
ACCESS_TOKEN = '...'
ACCESS_SECRET = '...'
CONSUMER_KEY = '...'
CONSUMER_SECRET = '...'
def connect_to_twitter_OAuth():
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
@danromero
danromero / feed.xml
Last active February 21, 2020 06:51
Linklog RSS feed for Jekyll
---
layout: none
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" >
<generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator>
<link href="{{ site.url }}/feed.xml" rel="self" type="application/atom+xml" />
<link href="{{ site.url }}" rel="alternate" type="text/html" />
<updated>2020-02-20T17:02:57-08:00</updated>
<id>{{ site.url }}/feed.xml</id>
@danromero
danromero / delighted_nps_distribution.py
Created February 20, 2017 22:18
Show the distribution of the last 100 Delighted.com NPS responses
%matplotlib inline
import delighted
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Add your Delighted API key — https://delighted.com/account/api
delighted.api_key = 'INSERT API KEY HERE'
x = delighted.SurveyResponse.all(order='desc:updated_at', per_page=100)