Wesleyan-Media-Project/fb_ad_scraper — reverse-engineered prompt
Reverse engineered prompt
Build me a small data collection tool for Facebook political ad media. I need it to keep a database of ad ids waiting to be processed, download the images, videos, screenshots, and audio from each ad, save the files into folders by media type and month, and write the file details back to the database so I can tell what was collected and avoid duplicates.
It should include a database setup script, a way to fill the queue from an existing table of Facebook ad records, and a scraper that runs continuously, takes the next ad from the queue, opens the ad page in Chrome, captures the media, records URLs, file sizes, dimensions, checksums, page ids, ad ids, and any errors. Assume I already have Facebook ad metadata from another import process and may have a Facebook Ad Library API token. Please make the setup clear enough that I can run it on a server and check logs when something fails. Look up current docs online if you need to.
Want more depth? Deep Reverse