Neomech Posted October 21, 2009 Share Posted October 21, 2009 I'm in an odd situation where I need to figure out if anything "new" has shown up in the first 100 results of several different Google searches. I obviously want to avoid having to do this manually, but I'm not sure how to go about doing what I want to do. Can someone suggest a good approach for automatically comparing the results of a Google search done on Day X with the same search done on Day Y, and being alerted if there's been a change within the first Z results? I'm not looking for any code, just the general approach one might take. Thanks! Link to comment https://forums.phpfreaks.com/topic/178470-how-do-i-automate-checking-google-for-changes-to-search-results/ Share on other sites More sharing options...
thebadbad Posted October 21, 2009 Share Posted October 21, 2009 Google doesn't allow automated searches. But apart from that, you could scrape the result pages (may be a good idea to set the user agent string before you load the pages with either file_get_contents() or cURL), putting page links into an array and store it, then repeat some other day, and compare the arrays with some of the array functions (or MySQL functions if you store the information in a database). The hardest part would be to grab the result links from the source code. But should be doable with the proper regular expression, or maybe with PHP DOM (but I doubt it looking at Google's source code). E.g. I first thought that the result link anchors had the exlusive class l (lowercase L), but also book search and news results have those. Link to comment https://forums.phpfreaks.com/topic/178470-how-do-i-automate-checking-google-for-changes-to-search-results/#findComment-941156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.