#!/usr/bin/perl ############################################################################# ## pod.cgi version 1.95 ## ## Personal Open Directory (POD) - dmoz Version ## ## John M. Grohol ## Originally Released: 04 Jan 1999 ## http://grohol.com/ ## ## This version: ## 25 Mar 2004 ## ## Based on maxcomm.cgi by Ross Faulds Internationalization modification by ## Checkpoint Computer Consultants Ltd Scott Stevenson ## http://www.computer-mentors.co.uk/ extra_lovin@yahoo.com ## Richard A. Chiswell ## (01 Feb 2000 (1.70d+) - 12 Dec 2000) ## http://www.beebware.com/ ## ## Copyright 1999-2004 by John M. Grohol. All rights reserved. ## ## Free to distribute, but you cannot charge for this work or any ## derivatives thereof. No warranties on this program are made or implied. ## ## Warning: ## Because of the dynamic nature of the ODP third-party provider we're ## using (Dmoz.Org), this script changes frequently to keep up-to-date ## with changes ODP makes to the formatting of their site. ## Be prepared to update this script regularly. Starting with version 1.31, ## changes are noted also within the script itself. ## ## ############################################################################# ## Configuration area ## ## Configuration variables are now in separate file called "podvars.pm" ## Place this file in the same directory as POD (add full path before ## filename below if you're having troubles). ## See the documentation for full installation and configuration details require "podvars.pm"; ############################################################################# ## Please avoid altering the code beyond this point. If you make any ## changes, please contact the authors so that your changes can be ## integrated into the official version so everybody can benefit ############################################################################# $SIG{ALRM} = 'pod_timout'; # increment is the subroutine to call when the alarm(20); # Script will timeout after 20 seconds # (change if you'd like) # Declare all the bits and pieces $pod_version="v1.95"; require 5.004; use CGI; if (defined($pod_modperl)) { CGI->compile(':all'); }; # Any error messages send to the browser use CGI::Carp 'fatalsToBrowser'; $CGI::POST_MAX=5*1024; # maximum of 5k length posts accepted - helps prevent DOS attacks $CGI::DISABLE_UPLOADS=1; # no uploads permitted - helps prevent DOS attacks use LWP::UserAgent; use HTTP::Request; use HTTP::Response; ############################################################################# ## Main program ############################################################################# &pod_main; exit 0; sub pod_main { &pod_init; if ($pod_debug) { print "Content-Type:text/html\n\nDEBUGGING"; print qq~ ~; print "

Debugging mode ON


"; print "
\n"; print "Entering: pod_main
\n"; } # Build a char->hex map for (0..255) { $pod_escapes{chr($_)} = sprintf("%%%02X", $_); } $pod_output=""; $pod_q = new CGI; $pod_tag = $pod_q->param("tag"); $pod_referer=$ENV{'HTTP_REFERER'}; if ($pod_usequery=='1') { $pod_dir = $pod_q->param("dir"); #$pod_dir = $ENV{'QUERY_STRING'}; #$pod_dir =~ s/%([\dA-Fa-f]{2})/pack("C", hex($pod_1))/eisg; $pod_dir = pod_unescape($pod_dir); $pod_dirext = "?dir="; } else { # ------------------------------------------------------------------------------------- # Note: # If you're having troubles with your POD complaining of a NOT FOUND error, # or some other problem related to the directory not showing properly the # path name to a subdirectory or the like, try this fix: # # Comment out the PATH_INFO line below like this: # # $pod_dir=$ENV{'PATH_INFO'}; # # Then simply remove the comments in front of these two lines and you should be set: # # $pod_dir=$ENV{'REQUEST_URI'}; # $pod_dir =~ s/$pod_fullpath(.*)/$1/ ; $pod_dir=$ENV{'PATH_INFO'}; # ------------------------------------------------------------------------------------- $pod_query_string=$ENV{'QUERY_STRING'}; if (length($pod_query_string)>0) { $pod_dir=$pod_dir."?$pod_query_string"; } $pod_dir =~ s/%([\dA-Fa-f]{2})/pack("C", hex($pod_1))/eisg; $pod_dirext = ""; } $pod_which_dir = "http://dmoz.org"; if ($pod_debug) { print "Full path details: $pod_fullpath$pod_dirext
"; } &pod_read_headers; if (defined($pod_logging)) { &pod_log_search($pod_cgi_search); } $pod_tag = $pod_q->param("tag"); $pod_validpage=0; $pod_output=$pod_output.&pod_page_header; $pod_cgi_content = &pod_get_first_page; if ($pod_validpage==0) { &pod_modify_content; } if ($pod_validpage==2) { &pod_redirect($pod_cgi_content); } else { # jmg # v.192 my $tag_cat = $pod_url; $tag_cat =~ s/http:\/\/www.dmoz.org//g; $tag_cat =~ s/http:\/\/dmoz.org//g; $pod_output=$pod_output.&pod_page_footer($tag_cat); # &pod_output($pod_output,$pod_expire_in); } if ($pod_debug) { print "Leaving: pod_main
\n"; }; } sub pod_output { if ($pod_debug) { print "Entering: pod_output
\n"; }; # Output the headers and file to the user # Argument of this function are: # output text,amount of time to expiry my $pod_po_output=shift(@_); my $pod_po_expire_in=shift(@_); $pod_po_length=length($pod_po_output); # Let's try and use no-parsed headers - it should fix any problems with # Microsoft Internet Information Servers (MIIS). # v1.71d - nph headers don't work, let's disable them # v1.72d - lets now make them definable if (defined($pod_headersuppress)) { # 1.95 print $pod_q->header(-type=>'text/html',-charset=>'UTF-8'); } else { print $pod_q->header(-type=>'text/html', -charset=>'UTF-8', -Expires=>$pod_po_expire_in, -MIME_Version=>"1.0", -"Content-Length"=>$pod_po_length); } print "$pod_po_output"; if ($pod_debug) { print "Leaving: pod_output
\n"; }; } sub pod_redirect { # Output the headers and file to the user # Argument of this function are: # redirection URL my $pod_pr_redirectto=shift(@_); if ($pod_debug) { print "Entering: pod_redirect $pod_pr_redirectto
\n"; }; # Let's try and use no-parsed headers - it should fix any problems with # Microsoft Internet Information Servers (MIIS). print $pod_q->redirect(-location=>$pod_pr_redirectto, -method=>'GET', -MIME_Version=>"1.0"); if ($pod_debug) { print "Leaving: pod_redirect
\n"; }; } ## This is where the magic occurs. We do a number of checks for certain HTML ## on the dmoz site and begin the massive search and replace on each page fetched. ## This isn't pretty, is very dependent on the HTML, but it works. sub pod_modify_content { if ($pod_debug) { print "Entering: pod_modify_content
\n"; }; @page = split(/\n/,$pod_cgi_content); $pod_skip=0; $pod_endpoint = 0; $pod_des = "desc.html"; $pod_faq = "faq.html"; foreach $pod_line (@page) { $_ = $pod_line; # 1.79 if (($pod_line =~ /

FAQ/) || ($pod_line =~ /odphead.gif/) || ($pod_line =~ /img\/opendir.gif/)) { $pod_skip = 1; } # Comment out the below line if Internationalization is giving you troubles! if (defined($pod_international)) { &pod_international; } $pod_line = &pod_unescape($pod_line); # 1.92 # handle topbar line and volunteer line in search results if ($pod_line =~ //) { $pod_skip = 0; $pod_topbar_skip = 1; } if (($pod_line =~ /<\/td><\/tr><\/table>/) && ($pod_topbar_skip ==1)) { $pod_skip = 1; $pod_topbar_skip = 0; } $pod_line =~ s/Volunteer<\/a> to edit this category./<\/a>/g; # 1.87 $pod_line =~ s/\"Open<\/a>//gi; $pod_line =~ s//$pod_frontheader/gi; $pod_line =~ s//$pod_frontheader/gi; $pod_line =~ s/\"Open
/
/g; # $pod_line =~ s/align=middle><\/td><\/tr>
/<\/td><\/tr>
/gi; $pod_line =~ s/$pod_frontheader<\/a/gi; # 1.79 $pod_line =~ s/])/$pod_frontheader/gi; if (defined($pod_coolicon)) { $pod_line=~s//$pod_coolicon/gi; } $pod_line =~ s/alt=\"Open Directory Project\" border=0><\/a>/\ \;/gi; $pod_line =~ s/valign=middle> \ \; $pod_name<\/b><\/font>/gi; $pod_line =~ s/
<\/a><\/center>

/

$pod_frontheader<\/center><\/td><\/tr><\/table><\/center>/gi; $pod_line =~ s/<\/center>/<\/center><\/center>/gi; $pod_line =~ s/height=25 alt=\"Open Directory Project\" align=middle border=0><\/a> <\/td>/\ \;<\/td>/gi; $pod_line =~ s/border=0 alt=\"Open Directory Project\"><\/a><\/td><\/tr>
<\/tr>
/$pod_killmozzie/gi; # 1.75 $pod_line =~ s//$pod_killmozzie/gi; } # 1.75 $pod_line =~ s/\"img\//\"http:\/\/dmoz\.org\/img\//gi; $pod_line =~ s/\"\/img\//\"http:\/\/dmoz\.org\/img\//gi; # 1.76 $pod_line =~ s/
home<\/a>/\"$pod_myhome\">home<\/a> | $pod_shortname<\/a>/gi; $pod_line =~ s/action=\"search/action=\"$pod_fullpath$pod_dirext/gi; $pod_line =~ s/href=\"search/href=\"$pod_fullpath$pod_dirext/gi; $pod_line =~ s/action=\"osearch/action=\"$pod_fullpath$pod_dirext/gi; $pod_line =~ s/href=\"osearch/href=\"$pod_fullpath$pod_dirext/gi; # 1.77 $pod_line =~ s/img src=\"\/World/img src=\"http:\/\/dmoz.org\/World/gi; $pod_line =~ s///gi; $pod_line =~ s/=\"http:\/\/search\.dmoz\.org\/cgi-bin\/osearch/=\"$pod_fullpath$pod_dirext\/cgi-bin\/osearch/gi; $pod_line =~ s/href=\"http:\/\/dmoz\.org/href=\"$pod_fullpath$pod_dirext/gi; $pod_line =~ s/href=\"http:\/\/search\.dmoz\.org\/cgi-bin\/search/href=\"$pod_fullpath$pod_dirext\/cgi-bin\/search/gi; if (($pod_amazon_ID) && ($pod_line =~ /amazon\.com/)) { $pod_line =~ s/odp/$pod_amazon_ID/g; } $pod_line =~ s/#f0f0f0/$pod_editortable/g; if (defined($pod_whichamazon) && ($pod_line =~ /<\/[Ff][Oo][Rr][Mm]>/)) { $pod_line =~ s/<\/form>//gi; &pod_amazon; } $pod_line =~ s/href=\"$pod_fullpath$pod_dirext\/editors\//href=\"http:\/\/dmoz.org\/editors\//gi; # 1.81 $pod_line =~ s/where=search/where=link/gi; &pod_modify_content_cgi; # 1.86 if ($pod_line =~ /home_attribute\.gif/) { $pod_line =~ s/(.*)where=(.*)\">
Help build the largest human-edited directory on the web.
Submit a Site - Open Directory Project - Become an Editor
~; } if (($pod_line =~ //)) { $pod_skip = 0; if ((length($pod_dir) < 4) && ($pod_cgi_search)) { $pod_output="$pod_output 
\n"; } $pod_endpoint = 1; } if ($pod_skip ==1) { $pod_output="$pod_output$pod_line\n";} last if ($pod_endpoint == 1); } if ($pod_debug) { print "Leaving: pod_modify_content
\n"; }; } sub pod_modify_content_cgi { # Modifies all references to the DMoz cgi-bin and re-writes them to point # correctly back to this script if (($pod_line =~ /[Aa][Cc][Tt][Ii][Oo][Nn]/) && (!($pod_line =~ /cgi-bin/))) { $pod_line =~ s/action=\"([^2]+)2\.cgi\"/action=\"http:\/\/dmoz\.org\/cgi-bin\/$1~~2\.cgi\"/; } $pod_line =~ s/~~//gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/feedback.cgi/$pod_fullpath\/cgi-bin\/feedback\.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/add2\.cgi/$pod_fullpath\/cgi-bin\/add2.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/update2\.cgi/$pod_fullpath\/cgi-bin\/update2.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/update3\.cgi/$pod_fullpath\/cgi-bin\/update3.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/send2\.cgi/$pod_fullpath\/cgi-bin\/send2.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/apply2\.cgi/$pod_fullpath\/cgi-bin\/apply2.cgi/gi; $pod_line =~ s/http:\/\/dmoz\.org\/cgi-bin\/forgot\.cgi/$pod_fullpath\/cgi-bin\/forgot.cgi/gi; $pod_line =~ s/action=\"\/cgi-bin\/feedback2\.cgi\"/action=\"http:\/\/dmoz.org\/cgi-bin\/feedback2\.cgi\"/gi; } sub pod_escape { my($text, $patn) = @_; return undef unless defined $text; if (defined $patn){ unless (exists $subst{$patn}) { $subst{$patn}=eval "sub {\$_[0] =~ s/([$patn])/\$pod_escapes{\$1}/g; }"; } &{$subst{$patn}}($text); } else { $text =~ s/([\x00-\x20"#%;<>?{}|\\\\^~`\[\]\x7F-\xFF])/$pod_escapes{$1}/g; #" } return $text; } sub pod_unescape { my @copy = @_; for (@copy) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; } wantarray ? @copy : $copy[0]; } # Amazon.com link # Slight change by WizarDave sub pod_amazon { if ($pod_debug) { print "Entering: pod_amazon
\n"; }; if (length($pod_dir) > 3) { $pod_topx = $pod_dir; if (index($pod_topx,"?") > 0) { if ($pod_topx =~ "nsidircat") { $pod_triz=rindex($pod_topx,"?"); if (!(defined($pod_amazon_missing))) { $pod_triz=$pod_triz-1; } } else { $pod_triz = rindex($pod_topx,"?"); } } else { $pod_triz=length($pod_triz); if (!(defined($pod_amazon_missing))) { $pod_triz=$pod_triz-1; } } $pod_topx = substr($pod_topx,0,$pod_triz); $pod_tidx = rindex($pod_topx,"/"); $pod_topic = substr($pod_topx,$pod_tidx); } else { $pod_topic = $pod_cgi_search; } # 1.76 if (length($pod_topic) < 3) { $pod_topic = $pod_cgi_search; } $pod_topic =~ s/\///g; $pod_topic_dis = $pod_topic; $pod_topic =~ s/[_ ]/+/g; $pod_topic_dis =~ s/_/ /g; $pod_output="$pod_output
\n\n"; if ($pod_topic) { $pod_output="$pod_output".qq~
Find books on: $pod_topic_dis at $pod_bookstorename. ~; } $pod_output="$pod_output".qq~
Search at $pod_bookstorename:
~; if (!($pod_topic)) { $pod_output="$pod_output
\n"; } if ($pod_debug) { print "Leaving: pod_amazon
\n"; }; } sub pod_read_headers { ## This function rips out all the possible parameters which could ## have been sent to this script in the cgi call. These must be ## retained in case they need to be sent to Dmoz.org if ($pod_debug) { print "Entering: pod_read_headers
\n"; }; $pod_cgi_all=$pod_q->param("all"); $pod_cgi_ax=$pod_q->param("a.x"); $pod_cgi_affiliation=$pod_q->param("affiliation"); $pod_cgi_cat=$pod_q->param("cat"); $pod_cgi_co=$pod_q->param("co"); $pod_cgi_comments=$pod_q->param("comments"); $pod_cgi_cp=$pod_q->param("cp"); $pod_cgi_description=$pod_q->param("description"); $pod_cgi_des_one=$pod_q->param("des1"); $pod_cgi_des_two=$pod_q->param("des2"); $pod_cgi_des_three=$pod_q->param("des3"); $pod_cgi_desc=$pod_q->param("desc"); $pod_cgi_direct=$pod_q->param("direct"); $pod_cgi_email=$pod_q->param("email"); $pod_cgi_emailaddr=$pod_q->param("emailaddr"); $pod_cgi_firstname=$pod_q->param("firstname"); $pod_cgi_fo=$pod_q->param("fo"); $pod_cgi_id=$pod_q->param("id"); $pod_cgi_index=$pod_q->param("index"); $pod_cgi_jsites=$pod_q->param("jsites"); $pod_cgi_jstart=$pod_q->param("jstart"); $pod_cgi_lastname=$pod_q->param("lastname"); $pod_cgi_lk=$pod_q->param("lk"); $pod_cgi_morecat=$pod_q->param("morecat"); if ($pod_dir =~ /morecat/) { $pod_cgi_morecat = 1; } $pod_cgi_newurl=$pod_q->param("newurl"); $pod_cgi_password=$pod_q->param("password"); $pod_cgi_passverify=$pod_q->param("passverify"); $pod_cgi_reason=$pod_q->param("reason"); $pod_cgi_start = $pod_q->param("start"); $pod_cgi_search = $pod_q->param("search"); if (($pod_dir =~ /search/) && (!($pod_dir =~ /srp/))) { $pod_trg=rindex($pod_dir, "search"); $pod_tre=index($pod_dir,"=",$pod_trg); $pod_cgi_search=substr($pod_dir,$pod_tre+1); } $pod_cgi_search=~ s/\`//g; $pod_cgi_search=~ s/\'//g; $pod_cgi_so=$pod_q->param("so"); $pod_cgi_title=$pod_q->param("title"); $pod_cgi_tit_one=$pod_q->param("tit1"); $pod_cgi_tit_two=$pod_q->param("tit2"); $pod_cgi_tit_three=$pod_q->param("tit3"); $pod_cgi_url=$pod_q->param("url"); $pod_cgi_url_one=$pod_q->param("url1"); $pod_cgi_url_two=$pod_q->param("url2"); $pod_cgi_url_three=$pod_q->param("url3"); $pod_cgi_user=$pod_q->param("user"); $pod_cgi_username=$pod_q->param("username"); $pod_cgi_where=$pod_q->param("where"); # The following two lines allow you to pass an alternative # inital category by passing the variable pod_debug_path $pod_cgi_debug_dir=$pod_q->param("pod_debug_path"); if ($pod_cgi_debug_dir) { $pod_dir=$pod_cgi_debug_dir; }; if ($pod_debug) { print "Leaving: pod_read_headers
\n"; }; } sub pod_get_first_page { ## Fetch the pages from the Dmoz server, but re-write the URLs of certain ## ones so we fetch the correct page. if ($pod_debug) { print "Entering pod_get_first_page
\n"; }; my $pod_gfp_toget = 0; $pod_cgi_search =~ s/ /+/g; if ($pod_dir =~ /\/osearch/) { $pod_url = "http://search.dmoz.org/cgi-bin/osearch\?search\=$pod_cgi_search"; if ($pod_cgi_start) { $pod_url = $pod_url . "&start=$pod_cgi_start"; } if ($pod_cgi_fo) { $pod_url = $pod_url . "&fo=$pod_cgi_fo"; } if ($pod_cgi_so) { $pod_url = $pod_url . "&so=$pod_cgi_so"; } if ($pod_cgi_co) { $pod_url = $pod_url . "&co=$pod_cgi_co"; } if ($pod_cgi_ax) { $pod_url = $pod_url . "&a.x=$pod_cgi_ax";} } elsif (($pod_cgi_search) && (not($pod_cgi_jstart)) && (!($pod_cgi_morecat))) { $pod_url = "http://search.dmoz.org/cgi-bin/search\?search\=$pod_cgi_search&a.x=$pod_cgi_ax"; } elsif (($pod_cgi_jstart > 0) && (!($pod_cgi_morecat))) { $pod_url = "http://search.dmoz.org/cgi-bin/search\?cp=$pod_cgi_cp&search\=$pod_cgi_search&a.x=$pod_cgi_ax&jstart=$pod_cgi_jstart"; } elsif ($pod_cgi_morecat > 0) { $pod_url = "http://search.dmoz.org/cgi-bin/search\?search\=$pod_cgi_search&a.x=$pod_cgi_ax&morecat=$pod_cgi_morecat"; } elsif ($pod_dir =~ "/searchguide.html") { $pod_url ="http://search.dmoz.org/searchguide.html"; } elsif ($pod_dir =~ "/cgi-bin/add2.cgi") { $pod_gfp_toget=1; } elsif ($pod_dir =~ "/cgi-bin/update2.cgi") { $pod_gfp_toget=2; } elsif ($pod_dir =~ "/cgi-bin/update3.cgi") { $pod_gfp_toget=3; } elsif ($pod_dir =~ "/cgi-bin/apply2.cgi") { $pod_gfp_toget=4; } elsif ($pod_dir =~ "/cgi-bin/forgot.cgi") { $pod_gfp_toget=5; } elsif (($pod_dir =~ "/rdf/") && ($pod_dir =~ ".gz")) { # Handle RDF dumps $pod_validpage=2; $pod_url=$pod_which_dir.$pod_dir; } else { $pod_url = $pod_which_dir . $pod_dir; if ($pod_cgi_jsites) { $pod_url = $pod_url . "&jsites=$pod_cgi_jsites"; } if ($pod_cgi_jstart) { $pod_url = $pod_url . "&jstart=$pod_cgi_jstart"; } if ($pod_cgi_start) { $pod_url = $pod_url . "&start=$pod_cgi_start"; } if ($pod_cgi_fo) { $pod_url = $pod_url . "&fo=$pod_cgi_fo"; } if ($pod_cgi_so) { $pod_url = $pod_url . "&so=$pod_cgi_so"; } if ($pod_cgi_co) { $pod_url = $pod_url . "&co=$pod_cgi_co"; } if ($pod_cgi_search) { $pod_url = $pod_url . "&search=$pod_cgi_search"; } if ($pod_morecat) { $pod_url = $pod_url . "&morecat=$pod_morecat"; } } if ($pod_gfp_toget > 0) { $pod_url=$pod_which_dir.$pod_dir; } # Don't escape out the URL yet... # Sometimes (for example, in conjunction with the search system) it # returns 404. # $pod_url=&pod_escape($pod_url); if ($pod_debug) { print "Parsed URL: $pod_url
\n"; }; if ($pod_validpage==0) { # 1.90 my $rand_num = ""; srand(time ^ $$); $rand_num = int(rand(50)); my $br_ver = ""; if ($rand_num gt 30) { $br_ver = "5"; } elsif ($rand_num lt 20) { $br_ver = "01"; } else { $br_ver = "0"; } my $pod_ua = LWP::UserAgent->new(); $ag_ver = "Mozilla/4.0 (compatible; MSIE 5." . $br_ver . "; Windows 98)"; $pod_ua->agent($ag_ver); # my $pod_ua =new LWP::UserAgent; # $pod_ua->agent("$pod_useragent"); if (defined($pod_proxy)) { $pod_ua->proxy('http',$pod_proxy); } my $pod_req; my $tmp_text; if ($pod_gfp_toget==0) { $pod_req = new HTTP::Request('GET',$pod_url); $pod_req->content_type('application/x-www-form-urlencoded'); } else { $pod_req = new HTTP::Request('POST',$pod_url); $pod_req->content_type('application/x-www-form-urlencoded'); if ($pod_gfp_toget==1) { $tmp_text="index=$pod_cgi_index&where=$pod_cgi_where". "&url=$pod_cgi_url&title=$pod_cgi_title&". "description=$pod_cgi_description&email=$pod_cgi_email"; } elsif ($pod_gfp_toget==2) { $tmp_text="lk=$pod_cgi_lk&id=&pod_cgi_id&where=$pod_cgi_where". "&url=$pod_cgi_url"; } elsif ($pod_gfp_toget==3) { $tmp_text="where=$pod_cgi_where&direct=$pod_cgi_direct". "&url=$pod_cgi_url&lk=$pod_cgi_lk&id=$pod_cgi_id". "&newurl=$pod_cgi_newurl&title=$pod_cgi_title". "&desc=$pod_cgi_desc&emailaddr=$pod_cgi_emailaddr". "&reason=$pod_cgi_reason"; } elsif ($pod_gfp_toget==4) { $tmp_text="where=$pod_cgi_where&id=$pod_cgi_id&lk=$pod_cgi_lk". "&firstname=$pod_cgi_firstname&lastname=$pod_cgi_lastname". "&emailaddr=$pod_cgi_emailaddr&username=$pod_cgi_username". "&password=$pod_cgi_password&passverify=$pod_cgi_passverify". "&comments=$pod_cgi_comments&affiliation=$pod_cgi_affiliation". "&url1=$pod_cgi_url_one&tit1=$pod_cgi_tit_one". "&des1=$pod_cgi_des_one". "&url2=$pod_cgi_url_two&tit1=$pod_cgi_tit_two". "&des1=$pod_cgi_des_two". "&url3=$pod_cgi_url_three&tit1=$pod_cgi_tit_three". "&des1=$pod_cgi_des_three"; } elsif ($pod_gfp_toget==5) { $tmp_text="user=$pod_cgi_user"; } $pod_req->content($tmp_text); } $pod_req->header('Referer',"$pod_referer"); if ($pod_debug) { print "
URL fetching: $pod_url
\n"; if ($pod_gfp_toget==0) { print "Getting...
\n"; } else { print "POSTing...
\n$tmp_text
\n"; } print "
\n"; } my $pod_res = $pod_ua->request($pod_req); # Check the outcome of the response $pod_base=$pod_res->base; if ($pod_res->is_success) { $pod_cgi_content = $pod_res -> content(); } else { $pod_validpage=1; $pod_status=$pod_res->status_line; $pod_output="$pod_output

POD encountered the following error while trying to run:
$pod_status\n"; $pod_output="$pod_output
Attempted retrieval URL: $pod_url

\n\n"; } } else { # a redirect $pod_cgi_content=$pod_url; if ($pod_debug) { print "
Redirecting to: $pod_url
\n"; } } if ($pod_debug) { print "Leaving: pod_get_first_page
\n"; }; return $pod_cgi_content; } sub pod_log_search { if ($pod_debug) { print "Entering pod_log_search
\n"; }; my $pod_searchwords = shift(@_); my $pod_month_day; my $pod_month_year; my $pod_year; my @pod_months=('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); ($pod_month_day,$pod_month_year,$pod_year)=(localtime)[3,4,5]; $pod_year+=1900; if ($pod_month_day<10) { $pod_month_day="0$pod_month_day"; } $datej = "$pod_month_day $pod_months[$pod_month_year] $pod_year"; open (WRITEIT, ">>$pod_logging"); flock(WRITEIT, LOCK_EX); seek (WRITEIT, 0,2); print WRITEIT "$datej|$pod_searchwords\n"; close(WRITEIT); if ($pod_debug) { print "Leaving pod_log_search
\n"; }; } sub pod_international { # Internationalization mod contributed by: # Scott Stevenson in 1999 extra_lovin@yahoo.com if (($pod_line =~ /%/) && ($pod_line =~/
//; if ($pod_line =~ /
  • //; $pod_output="$pod_output
  • "; } else { $pod_output="$pod_output"; } } } sub pod_timout { } 1;