Skip to content

Instantly share code, notes, and snippets.

@jeffehobbs
jeffehobbs / birdnetpi_hardware.txt
Last active July 7, 2023 14:13
BirdNetPi Hardware List + Basic Instructions
Equipment for BirdNet
SUMMARY: You’ll need a decent Raspberry Pi, a case, a microSD card, a decent USB mic, a longish USB cable
and a decent power supply. It’ll run you about $150.
COMPUTER: RASPBERRY PI 4, 4GB ($55)
I’m using this, it works great. $55.
https://www.adafruit.com/product/4296
@jeffehobbs
jeffehobbs / radiodreambot.py
Last active January 26, 2025 16:21
record radio, transcribe it, make art
# radiodreambot | [email protected]
# record radio, transcribe it, make art
import requests, os, shutil, configparser, datetime, time, multiprocessing, openai, tweepy, subprocess
from mastodon import Mastodon
from faster_whisper import WhisperModel
from atproto import Client
from PIL import Image
#STREAM_URL = 'https://live.wostreaming.net/direct/saga-wrsifmaac-ibc2'
@jeffehobbs
jeffehobbs / app.py
Last active July 8, 2023 16:27
AWS lambda wrapper for WeatherKit API + OpenAI Summarization
# generates a REST lambda for WeatherKit data & OpenAI summarization
import requests, json, os, boto3, configparser
from flask import Flask, Response, request, json, jsonify
import openai
app = Flask(__name__)
# set up API keys from external config secrets.txt configparser file
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
@jeffehobbs
jeffehobbs / curbalertbot.py
Last active January 26, 2025 16:19
curbalertbot - filters free stuff by location and tweets new items. https://twitter.com/CurbAlertBot
# curbalert
# [email protected] // last revision Jan 2025
import asyncio
import tweepy, requests, configparser, json, os, shutil, hashlib, time
from termcolor import colored, cprint
from pyppeteer import launch
from mastodon import Mastodon
from atproto import Client, client_utils
@jeffehobbs
jeffehobbs / policelog.py
Last active January 26, 2025 16:20
police log bot: 1. pulls/filters RSS for search phrase, 2. scrapes page, 3. gets text, 4. builds art, 5. tweets
# policelog.py // [email protected]
#
# todo:
#
# 1. get latest police log from RSS feed
# 2. scrape html and get individual log entries
# 3. if unique: pull text from entry, redact people's names, create illustration
# 4. tweet text and illustration
# 5. mastodon too
# 6. also bluesky
@jeffehobbs
jeffehobbs / configuration.yaml
Last active July 8, 2023 16:23
YAML configuration for WeatherKit data into Home Assistant
# Configuration for WeatherKit in Home Assistant: customize lat/long/token
rest:
- resource: https://weatherkit.apple.com/api/v1/weather/en/YOUR_LATITUDE/YOUR_LONGITUDE
headers:
Authorization: 'Bearer YOUR_TOKEN_HERE'
params:
countryCode: 'US'
dataSets: 'currentWeather,forecastDaily,forecastNextHour,forecastHourly,weatherAlerts'
timezone: 'GMT-5'
scan_interval: 60
@jeffehobbs
jeffehobbs / get_wk_token.py
Last active February 1, 2024 20:24
Get ADC WeatherKit token for REST API
# get_wk_token.py // [email protected] // Nov. 2022
# from documentation here, which you should read first:
# https://developer.apple.com/documentation/weatherkitrestapi/request_authentication_for_weatherkit_rest_api
#
# 1. Have a valid ADC acount. https://developer.apple.com
# 2. Download this script, and open it in a text editor. You'll have to change three variables.
# 3. Make up a reverse-domain name service ID (i.e., com.domain.app). Place this in SERVICE_ID.
# 4. Create an ADC service identifier. https://developer.apple.com/account/resources/identifiers/add/bundleId
# 5. Create an ADC service key. https://developer.apple.com/account/resources/authkeys/add
# 6. Download that service key, rename to 'wkservicekey.p8', and move it into same directory as this script.
@jeffehobbs
jeffehobbs / craigsdalle.py
Last active May 12, 2023 22:19
builds DALL-E art from Craigslists posts & tweets 'em (https://twitter.com/mistconnectnbot)
# craigsdalle - builds DALL-E art from Missed Connections posts & tweets
# [email protected] // November 2022
import asyncio
from pyppeteer import launch
import openai, tweepy, requests, configparser, os, shutil, hashlib
from mastodon import Mastodon
# set up API keys from external config apikeys.txt file
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
@jeffehobbs
jeffehobbs / quit_all.scpt
Last active July 18, 2022 19:16
AppleScript to quit all open Applications on MacOS
tell application "System Events" to set the visible of every process to true
set allow_list to {"Finder"}
try
tell application "Finder"
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to item i of the process_list
@jeffehobbs
jeffehobbs / waveform.py
Last active June 30, 2022 22:22
waveform.py: make cool lookin' twitter-sharable video from .wav file
# waveform.py | [email protected]
# Process an .wav audio file, make an .mp4 waveform video suitable for TWTR
# usage: waveform.py audiofile.wav
import subprocess, random, argparse, os
# get input
parser = argparse.ArgumentParser(description='Process an .wav audio file, make an .mp4 waveform video.')
parser.add_argument('file', type=str, help='filename')
args = parser.parse_args()