ahref.com > Guides >
Technology
Building a Site Submission Program, Continued
More Variable Setup
Lines 67-70 create and define a new UserAgent object using the LWP::UserAgent module. Line 68 gives our agent a name; this name will show up in the search engines' access logs and let them know what program was used to access their sites. Line 69 attaches an email address to the agent, so that the remote sites will know who to email if there is a problem. Line 70 sets the timeout value of the agent to 90 seconds. By default, an agent waits three minutes after accessing a page for the remote server's response. In our version of this program, we're using a default of 90 seconds (we're a little impatient).
67 my $ua = new LWP::UserAgent;
68 $ua->agent ("ahref.com multisubmit 1.0");
69 $ua->from ("piou\@ahref.com");
70 $ua->timeout (90);
Lines 72-78 customize the program's output for our site a little bit more. We don't include this text in our header file because the header file might be used for other programs for which this text doesn't apply.
72 $output_string = "<BLOCKQUOTE><FONT SIZE=\"2\"><A HREF=\"/index.html\">";
73 $output_string .= "<B>Anchor</B></A> > <A HREF=\"/guides/index.html\">Guides</A> > ";
74 $output_string .= "<A HREF=\"/guides/industry/index.html\">Industry</A> > ";
75 $output_string .= "Planting Seeds in All the Right Places<P></FONT>\n";
76 $output_string .= "<IMG SRC=\"/images/indyguideheader.gif\" ALT=\"Industry Guide\" ";
77 $output_string .= "ALIGN=BOTTOM WIDTH=\"455\" HEIGHT=\"61\" BORDER=\"0\">\n";
78 $output_string .= "<BR>\n<H3>Site Submitter Results</H3>\n";
|