Hi, I've had a blowout on an old script to ping a search engine for my page and am wondering if this one is right.
Has anyone experience with these things?
I did check Google's page about this and the xml appears to be in line with what they say there.
I know that using a pinging service can take ages, which is why I'm just pinging Google direct.
Any help would be appreciated,Code:#!/usr/bin/perl use strict; use warnings; require LWP::UserAgent; my $site_name = 'Site Name'; my $site_url = 'http://www.msite.com/'; my $site_rss = 'myblog.xml'; my %urls = ( 'Google' => 'http://blogsearch.google.com/ping/RPC2', ); my $content = <<EOF; <?xml version="1.0"?> <methodCall> <methodName>weblogUpdates.ping</methodName> <params> <param><value>$site_name</value></param> <param><value>$site_url</value></param> <param><value>$site_rss</value></param> </params> </methodCall> EOF foreach my $site (keys %urls) { print "Pinging $site..."; my $req = HTTP::Request->new('POST', $urls{$site}); $req->content_type('text/xml'); $req->content($content); my $ua = LWP::UserAgent->new; $ua->request($req)->as_string; }
many thanks


Reply With Quote
Bookmarks