I found a script called Adsense Code Checker that scans your files via FTP to check if your publisher ID has been swapped out with another one.
I'm curious if anyone knows of a script that could be run via cron and would crawl a specified number of pages (or specific URLs) to see if a publisher ID was different than the one specified (instead of scanning the files directly via FTP).
I know it wouldn't necessarily have to be a script directly written for this purpose, but in my searches so far I haven't come up with anything that would work.
(I know if someone unauthorized has access to your website files and database, then Adsense publisher ID should be the least of one's concerns, but this is still important for reasons I'd rather not explain)
I don't think I was clear enough, I'm looking for a script that actually crawls URLs on a website (either a specified list of URLs or a list built as the time of crawling) and checks for publisher IDs.
I have multiple cases where a publisher ID is stored in a MySQL database (ad system, forum, etc.) and would prefer to have the check done via the front end HTML actually served.
I'm not aware of anything specific but there are a ton of Perl and PHP crawler scripts out there that will do the crawling for you, just make sure you limit the actual crawl to your domain.
A simple bit of code inserted in a full site crawler can check each page returned for pub IDs that aren't yours and display an error or send an email.
If you want to do something much simpler look into site alarm monitors as many of them not only alarm you if your site is down, but can also alarm you if certain things don't appear in the HTML, such as your pub-ID. You pick the pages to monitor as I'd suspect your top 10 pages would be enough for a quick sanity check.
multiple cases where a publisher ID is stored in a MySQL database
Then you don't need to crawl the web site, you need to write a simple query to make sure only your Pub IDs exist, way easier than crawling a website.