Forum Moderators: martinibuster

Message Too Old, No Replies

A Competitive Ad Filter Tool

Finds outdated URL's, creates a new filter list.

         

bumpski

5:03 pm on Jan 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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]

incrediBILL

11:53 pm on Jan 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Anyone tried this?

Looks like it does a good job of finding dead domains in the competitive filter so you can eliminate those over time and get some space back in the filter list.

kevinashby

1:50 am on Feb 2, 2010 (gmt 0)

10+ Year Member



bumpski / incrediBILL,

I tried to use this, but got some errors. Sounds like it could be a great tool though.

When I have more time I will have a go at fixing the errors.

netmeg

3:21 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm gonna give a try later. Interesting.

incrediBILL

5:41 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



kevinashby, the errors are caused by a bug in WebmasterWorld's formatting that's being fixed.

The broken pipe char needs to be replaced by a solid pipe "|".

I have no clue what "Â" is, I don't think it should be there.

netmeg

8:18 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have no clue what "Â" is, I don't think it should be there.


Might it be an ampersand?

&&&

Nope, I can type ampersands. Then I give up.

bumpski

10:24 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You know when I originally posted this I could have sworn it came out formatted correctly. I'll try to post corrections shortly. (If I can!)

Thanks for the interest.

bumpski

10:41 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IncrediBill was close

The "¦" should be replaced with "|", the pipe character.

The line with "nslookup" should look like:

nslookup -type=A %1 2>nul | find /c "Address" | find "2" > nul

Many keyboards show this solid vertical bar as a double vertical bar just to confuse the issue more. Use "Shift" "backslash" (\)

Perhaps WW can edit the original post?

Sorry for the difficulty!

bumpski

11:39 am on Feb 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Clearly some WW encoding problems. The appearance of the text of my original post and the corrections have both changed since yesterday. I have both a Vista and XP machine. Oddly enough even though both posts have been altered the net result appears correct. I'm not sure how to make this correct in all cases.

netmeg

3:58 pm on Feb 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've seen this before. WebmasterWorld doesn't do true pipes.

kevinashby

9:14 am on Feb 9, 2010 (gmt 0)

10+ Year Member



Hi Bumpski/Bill,

Sorry, I was out sailing for a week with no comms.

Thanks for that tip guys, it works perfecly with the corrected Pipes.

Thanks,

Kevin

incrediBILL

8:01 pm on Feb 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've seen this before. WebmasterWorld doesn't do true pipes.


It should now, they've corrected the problem in the last few days.

I went back up and fixed the broken | in the code, check it out ;)

bumpski

3:14 pm on Feb 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Bill

The code looks good. I realized the post was actually showing different characters when viewed on Vista versus XP! (I use firefox). Looks good now!