HTTP::OAI::UserAgent(3pm) User Contributed Perl Documentation HTTP::OAI::UserAgent(3pm)NAME
HTTP::OAI::UserAgent - Extension of the LWP::UserAgent for OAI HTTP requests
DESCRIPTION
This module provides a simplified mechanism for making requests to an OAI repository, using the existing LWP::UserAgent module.
SYNOPSIS
require HTTP::OAI::UserAgent;
my $ua = new HTTP::OAI::UserAgent;
my $response = $ua->request(
baseURL=>'http://arXiv.org/oai1',
verb=>'ListRecords',
from=>'2001-08-01',
until=>'2001-08-31'
);
print $response->content;
METHODS
$ua = new HTTP::OAI::UserAgent(proxy=>'www-cache',...)
This constructor method returns a new instance of a HTTP::OAI::UserAgent module. All arguments are passed to the LWP::UserAgent
constructor.
$r = $ua->request($req)
Requests the HTTP response defined by $req, which is a HTTP::Request object.
$r = $ua->request(baseURL=>$baseref, verb=>$verb, %opts)
Makes an HTTP request to the given OAI server (baseURL) with OAI arguments. Returns an HTTP::Response object.
OAI-PMH related options:
from => $from
until => $until
resumptionToken => $token
metadataPrefix => $mdp
set => $set
$str = $ua->url(baseURL=>$baseref, verb=>$verb, ...)
Takes the same arguments as request, but returns the URL that would be requested.
$time_d = $ua->delay( $time_d )
Return and optionally set a time (in seconds) to wait between requests. $time_d may be a CODEREF.
perl v5.12.4 2011-06-23 HTTP::OAI::UserAgent(3pm)
Check Out this Related Man Page
HTTP::OAI::ListRecords(3pm) User Contributed Perl Documentation HTTP::OAI::ListRecords(3pm)NAME
HTTP::OAI::ListRecords - Provide access to an OAI ListRecords response
SYNOPSIS
my $r = $h->ListRecords(
metadataPrefix=>'oai_dc',
);
while( my $rec = $r->next ) {
print "Identifier => ", $rec->identifier, "
";
}
die $r->message if $r->is_error;
# Using callback method
sub callback {
my $rec = shift;
print "Identifier => ", $rec->identifier, "
";
};
my $r = $h->ListRecords(
metadataPrefix=>'oai_dc',
onRecord=>&callback
);
die $r->message if $r->is_error;
METHODS
$lr = new HTTP::OAI::ListRecords
This constructor method returns a new HTTP::OAI::ListRecords object.
$rec = $lr->next
Returns either an HTTP::OAI::Record object, or undef, if no more record are available. Use $rec->is_error to test whether there was an
error getting the next record.
@recl = $lr->record([$rec])
Returns the record list and optionally adds a new record or resumptionToken, $rec. Returns an array ref of HTTP::OAI::Records,
including an optional resumptionToken string.
$token = $lr->resumptionToken([$token])
Returns and optionally sets the HTTP::OAI::ResumptionToken.
$dom = $lr->toDOM
Returns a XML::DOM object representing the ListRecords response.
perl v5.12.4 2011-06-23 HTTP::OAI::ListRecords(3pm)
this may be very basic to some but all new to me
I have an application running on SCO Unix server which issues an HTTP Post request to a server with the results being returned in I.E browser window in XML format
I need to import these results into my customers application and dont know how to... (1 Reply)
The Web-based contact form on my site has been under distributed spamming attacks for nearly a month already. Obviously, a spammer has tried to generate HTTP requests containing ads to male drugs and all sorts of similar stuff directly to the form mail processor script on my site using a robot, as... (5 Replies)
At the moment I have the following code which visits the site then saves the page:
$req = HTTP::Request->new(POST => $url . '/search.php');
$data = $ua->request($req)->decoded_content;
open(HTMLfile, '>hello.html'); print HTMLfile $data; close(HTMLfile);
From the page it saves theres a URL,... (6 Replies)
Hello
I am trying to communicate with a server that is ready to accept HTTP GET requests and send back data per the request. However, I have very little experience in socket programming and I don't really know how to debug this. Googling on the web hasn't yielded much, except people saying I... (2 Replies)
Hi friends,
A script needs to be created to collect all HTTP GET requests containing a particular string say abcd.gif in the url path along with the IP address of the client that issued the request. The source of this data is the web server logs. Also Each script execution should extract... (4 Replies)
Hi,
I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log.
Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)