Well I was tuning up my Competitive Ad Filters and thought I should pass on this windows based tool that I wrote a few years back. (Sorry, Apple, Linux)
This batch file (filtersort.bat is a good name) will take a file that you have created (adfilters.txt) from your competitive filter list, and process your adfilterlist.txt into two new files, one named outdatedfilters.txt the other newfilterlist.txt. There also is a help feature (filtersort.bat /help, /?, etc.) When the batch file completes execution from a "command prompt" it will indicate how many filter URL's are valid and how many are probably outdated. It's nice to have a count of your filters! I have only run this on Windows XP.
This tool uses windows "nslookup" to check a domain's existence. nslookup has a two second timeout so at times this tool may falsely determine a domain is non-existent. If you suspect this happened simply run it again when you are having good internet performance.
Simply highlight your entire Competitive filter list and paste it into a file name adfilters.txt (Use notepad.exe). Delete any empty lines at the end of the file, there typically will be one. Place this file in the same directory with another file (filtersort.bat) you have created using the batch file text below. Start a windows command prompt in that directory and simply type "filtersort.bat". During execution the batch file will echo the domain it is currently checking for you. Your filter list may even have IP addresses in it. I've had advertisers with target URL's that are solely IP addresses.
See "Windows Command Prompt" here for an essential aid:
(Open Command Window Here) (Again Win XP)
[
microsoft.com...]
Disclaimer: Of course whenever you alter you Competitive Ad Filter list your earnings may be affected! If you have a list I'm sure you think this is true! I find it remarkable how long some of the crappy domains that exist in my filter list survive. I typically only find one or two outdated domains per year, out of hundreds.
Hope you find this useful. (Now I hope the code actually comes out OK in the post as well.)
The batch file:
@echo off
REM This batch file uses NSLOOKUP to check domain names.
REM The default timeout of NSLOOKUP is 2 seconds.
REM This default may falsely indicate a non existant domain.
if "%1"=="help" goto BuildFilesHelp
if "%1"=="HELP" goto BuildFilesHelp
if "%1"=="Help" goto BuildFilesHelp
if "%1"=="/?" goto BuildFilesHelp
if exist newfilterlist.txt del newfilterlist.txt
if exist outdatedfilters.txt del outdatedfilters.txt
set AdsenseFilterCount=0
set OutdatedFilterCount=0
FOR /f %%i IN (adfilters.txt) do call :BuildFiles %%i
echo -
echo New Filter Count= %AdsenseFilterCount%
echo Outdated Filter Count= %OutdatedFilterCount%
echo -
set AdsenseFilterCount=
set OutdatedFilterCount=
goto Exit
:BuildFiles
rem Recursive Entry Point
REM ping -n 1 -w 4000 %1
REM nslookup %1
echo %1
nslookup -type=A %1 2>nul | find /c "Address" | find "2" > nul
if errorlevel 1 goto NotFound else goto FoundIt
:FoundIt
echo %1 >> newfilterlist.txt
set /A AdsenseFilterCount=AdsenseFilterCount+1
goto Exit
:NotFound
echo %1 >> outdatedfilters.txt
set /A OutdatedFilterCount=OutdatedFilterCount+1
goto Exit
:BuildFilesHelp
echo -
echo A batchfile ".bat" to filter Adsense Competitve Ad filters into outdated and active lists.
echo Input file is assumed to be adfilters.txt
echo Output files are newfilterlist.txt and outdatedfilters.txt
echo NOTE: this is a recursive batch file, a batch file which invokes itself.
echo This makes maintainence very easy.
echo Copyright 2009,2010 Bob Matheson
echo -
:Exit
[edited by: incrediBILL at 8:03 pm (utc) on Feb 9, 2010]
[edit reason] fixed broken pipes code [/edit]