Thought this was a cool and fun project. Tweetalyzer roasts and analyzes your Twitter using Gemini 1.5 (gemini 2.0 as soon as ratelimits are dropped).
It’s also very easy to make your own - just add your own Gemini API key and your Scraper API key (I’m using Kaito since they are fast and have nice support, you can get your own for free by sending them a DM - not sponsored btw).
if it’s going to be reading and deduping this every two seconds, I feel like you might as well do this once on startup and keep a running Set in memory
// on startup
const uniqueUsers = new Set();
// prepopulate from log
// on rating
writeToLog(user);
uniqueUsers.add(user);
// get count
const count = uniqueUsers.size;
Just proxying the Gemini/OpenAI requests (I have a system where there’s a 50/50 chance to use each of them) and the scraper requests, counting and logging requests and serving everything.
update: switched to the latest version of bun using I've done it glitch - #11 by wh0. if you want to switch your project to bun too, I recommend remixing ~bun-starter since it already has most of the stuff (functional server, package.json for dependencies, etc) already pre-installed