Wikipedia talk:WikiProject U.S. Roads/Redirects/Texas/Farm to Market and Ranch to Market Roads

Writing a script
I could probably write a script to check each of them remove the ones that aren't listed. Options for automatic removal might include &lt;!-- commenting them out --&gt;, striking them out, or moving them to a separate section or page to be manually examined, just in case they are false negatives. — Apr. 25, '06 [12:53] <[ freakofnurxture]|[ talk]>

Script
I wrote a script to validate this list by checking TxDOT. Because I don't expect to continue maintaing this page, here is the perl script if anyone wants to re-check in the future.--Svgalbertian (talk) 17:58, 19 October 2010 (UTC) use strict; use LWP::Simple; use LWP::UserAgent; use HTTP::Request; use HTTP::Response;
 * 1) !/usr/bin/perl

my %roadURL = (       'FM' => 'http://www.dot.state.tx.us/tpp/hwy/fm%subdir%/fm%route%.htm',        'RM' => 'http://www.dot.state.tx.us/tpp/hwy/rm/rm%route%.htm',        'UR' => 'http://www.dot.state.tx.us/tpp/hwy/ur/ur%route%.htm', );
 * 1) Highway record URLs

open ( TXTFILE, ">wikitext.txt" ) || die ("you die now!");
 * 1) Output files

for (my $i = 1; $i < 4000; $i++) {
 * 1) Cycle through all the road pages

my %title = ; my $subdir = '';

if ($i >= 500) { use integer; $subdir = sprintf("%04d", ($i / 500) * 500); }

my $paddednum = sprintf("%04d", $i);
 * 1) Grab all the highway records from the internet

foreach my $routetype (keys (%roadURL)) { my $URL = $roadURL{$routetype};

(my $currenturl = $URL) =~s/\%route\%/$paddednum/g; $currenturl =~s/\%subdir\%/$subdir/g; my $contents = &getPage($currenturl);

$contents =~ m/ (.*?)<\/title>/; $title{$routetype} = $1; }

if($title{'FM'} !~ m/Page Not Found/) { if($title{'UR'} =~ m/Page Not Found/) { print "*\n"; print TXTFILE "*\n"; } else { print "*\n"; print TXTFILE "*\n"; }  	 }
 * 1) Does the FM route exist? If so is it also an UR?

if($title{'RM'} !~ m/Page Not Found/) { if($title{'UR'} =~ m/Page Not Found/) { print "*\n"; print TXTFILE "*\n"; } else { print "*\n"; print TXTFILE "*\n"; }  	 } }
 * 1) Does the RM route exist? If so is it also an UR?

close (TXTFILE);
 * 1) Close the files

use strict; sub getPage { # Function to get a webpage my($currenturl) = @_; my $contents;

my $browser = LWP::UserAgent->new; $browser->timeout(10);

my $request = HTTP::Request->new(GET => $currenturl); my $response = $browser->request($request);

$contents = $response->content;

return $contents; }