Prototype of embeddings-based search of Twitter likes/bookmarks on an infinite canvas
I’ve combined my 1) desire to re-surface content from my Twitter feed 2) embeddings & semantic search and 3) my love of infinite canvas UIs:
It’s an OpenAI embeddings-powered search tool for my Twitter likes & bookmarks, with advanced filtering, on an infinite canvas with draggable results.
This codebase is rather messy, but I documented the process of building the project with more screenshots on my blog. Run free with it!
bun i
Gathering your data is the most hacky process ever:
Create an empty file at lib/tasks/likes-urls.txt
Open Twitter, open the network tab > XHR in devtools, go to your profile’s likes page, scroll down a bunch (Cmd-down repeatedly). Right click, Copy all URLs
, paste them into the text file, filter for the ones matching Likes?
Create a file at lib/tasks/fetch-options.js
On your bookmarks page, right click the Bookmarks?
request in your devtools, Copy as fetch (Node.js)
, then paste all those headers into the fetch-options
file, like this:
export default const fetchOptions = {
headers: {
accept: "*/*",
"accept-language": "en-US,en;q=0.9",
authorization: "Bearer …"
In .env
, set your OPENAI_API_KEY
for embeddings
Install ChromaDB, in another terminal, chroma run
(you’ll need to keep this running)
If you’re using Zed, spawn the task for download, then for embedding. Otherwise, bun run lib/tasks/download.js
then bun run lib/tasks/embed.js
bun dev
MIT License. The tweet data in lib/db
is not mine.