#!/usr/bin/perl -w ############################### # 'corps_checker'(description: pings corporate websites and reports) # Copyright (C) 2008 Wayne Clements # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # See . # # # # Wayne Clements, www.in-vacua.com. email: invacua@btinternet.com # ############################### use strict; use warnings;# use Net::Ping; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:all); use HTTP::Date; srand; print "Content-type: text/html\n\n"; my $html2 =" corps_checker
     \"\"

  The potential sponsor:

"; print $html2; my %host = ( "www.burges-salmon.com" => "Burges Salmon LLP

    
", "www.thechelsea.co.uk" => "Chelsea Building Society

    
", "www.coutts.com" => "Coutts UK

    
", "www.deloitte.co.uk" => "Deloitte

    
", "www.edfenergy.com" => "EDF Energy

    
", "www.ltsbcf.co.uk" => "Lloyds TSB Commercial Finance

    
", "www.ldc.co.uk" => "Lloyds TSB Development Capital

    
", #"www.madeupmadeup.co.uk" => "MadeUpUrl

     #
", "www.barclays.com" => "Barclays

    
", "www.jpmorgan.com" => "J.P. Morgan (Bournmouth)

    
", "www.morgan-cole.com" => "Morgan Cole

    
", "www.prudential.co.uk" => "Prudential

    
", "www.hbosplc.com" => "HBOS

    
", "www.unilever.co.uk" => "Unilever

    
", "www.landsecurities.com" => "Land Securities

    
", "www.experian.co.uk" => "Experian

    
", "www.nab.com.au" => "National Australia Bank

    
", "www.pwc.com" => "PricewaterhouseCoopers

    
", "www.ey.com" => "Ernst & Young

    
", "www.shell.co.uk" => "Shell

    
", "www.legalandgeneral.com" => "Legal&General

    
", "www.willmottdixon.co.uk" => "Willmott Dixon

    
", "www.tftconsultants.com" => "Tuffin Ferraby Taylor

    
", "www.rbs.co.uk" => "Royal Bank of Scotland

    
" ); my $chosen; my $key; my $n = 0; my($k, $v); while(($k, $v) = each %host) { rand(++$n) < 1 and $chosen = $v, $key = $k; ## 1 x random hash pair choice } my $html1= "

    SOUTH-WEST
    Burges Salmon LLP
    Chelsea Building Society
    Coutts UK
    Deloitte
    EDF Energy
    Lloyds TSB Commercial Finance
SOUTH-WEST
Lloyds TSB Development Capital
J.P. Morgan (Bournmouth)
Northcroft
Morgan Cole
Tuffin Ferraby Taylor
Willmott Dixon
NATIONAL
Barclays
Experian
Ernst & Young
HBOS
Land Securities
Legal&General
NATIONAL
National Australia Bank
PricewaterhouseCoopers
Prudential
Royal Bank of Scotland
Shell
Unilever
"; if ($chosen =~ /Burges Salmon LLP/) { $html1 =~ s/Burges Salmon LLP/Burges Salmon LLP<\/b><\/span>/ig}; if ($chosen =~ /Chelsea Building Society/) { $html1 =~ s/Chelsea Building Society/Chelsea Building Society<\/b><\/span>/ig}; if ($chosen =~ /Coutts UK/) { $html1 =~ s/Coutts UK/Coutts UK<\/b><\/span>/ig}; if ($chosen =~ /Deloitte/) { $html1 =~ s/Deloitte/Deloitte<\/b><\/span>/ig}; if ($chosen =~ /Lloyds TSB Commercial Finance/) { $html1 =~ s/Lloyds TSB Commercial Finance/Lloyds TSB Commercial Finance<\/b><\/span>/ig}; if ($chosen =~ /Lloyds TSB Development Capital/) { $html1 =~ s/Lloyds TSB Development Capital/Lloyds TSB Development Capital<\/b><\/span>/ig}; #if ($chosen =~ /MadeUpUrl/) { #$html1 =~ s/MadeUpUrl/MadeUpUrl<\/b><\/span>/ig}; if ($chosen =~ /Barclays/) { $html1 =~ s/Barclays/Barclays<\/b><\/span>/ig}; if ($chosen =~ /HBOS/) { $html1 =~ s/HBOS/HBOS<\/b><\/span>/ig}; if ($chosen =~ /Prudential/) { $html1 =~ s/Prudential/Prudential<\/b><\/span>/ig}; if ($chosen =~ /Morgan Cole/) { $html1 =~ s/Morgan Cole/Morgan Cole<\/b><\/span>/ig}; if ($chosen =~ /Land Securities/) { $html1 =~ s/Land Securities/Land Securities<\/b><\/span>/ig}; if ($chosen =~ /Experian/) { $html1 =~ s/Experian/Experian<\/b><\/span>/ig}; if ($chosen =~ /National Australia Bank/) { $html1 =~ s/National Australia Bank/National Australia Bank<\/b><\/span>/ig}; if ($chosen =~ /PricewaterhouseCoopers/) { $html1 =~ s/PricewaterhouseCoopers/PricewaterhouseCoopers<\/b><\/span>/ig}; if ($chosen =~ /Ernst & Young/) { $html1 =~ s/Ernst & Young/Ernst & Young<\/b><\/span>/ig}; if ($chosen =~ /Willmott Dixon/) { $html1 =~ s/Willmott Dixon/Willmott Dixon<\/b><\/span>/ig}; if ($chosen =~ /Legal&General/) { $html1 =~ s/Legal&General/Legal&General<\/b><\/span>/ig}; if ($chosen =~ /Shell/) { $html1 =~ s/Shell/Shell<\/b><\/span>/ig}; if ($chosen =~ /Unilever/) { $html1 =~ s/Unilever/Unilever<\/b><\/span>/ig}; if ($chosen =~ /J.P. Morgan/) { $html1 =~ s/J.P. Morgan/J.P. Morgan<\/b><\/span>/ig}; if ($chosen =~ /Tuffin Ferraby Taylor/) { $html1 =~ s/Tuffin Ferraby Taylor/Tuffin Ferraby Taylor<\/b><\/span>/ig}; if ($chosen =~ /EDF Energy/) { $html1 =~ s/EDF Energy/EDF Energy<\/b><\/span>/ig}; if ($chosen =~ /Royal Bank of Scotland/) { $html1 =~ s/Royal Bank of Scotland/Royal Bank of Scotland<\/b><\/span>/ig}; my $time; my $string = time2str($time); ## gets time my $p = Net::Ping->new("syn"); $p->{port_num} = getservbyname("http", "tcp"); $p->tcp_service_check(1); print "    $chosen      is "; print "NOT! " unless $p->ping($key ); print "responding at $string\n"; $p->close(); print $html1; __END__