Data::CURL::CurlRequester - Build and send CURL requests to the Open Library (OL) RESTful API
Contain tools to create and send a request to the Open Library RESTful API that will return RDF fluxes. Prepares data to send it to the View::WebDisplayer.
The Data::CURL::CurlRequester wait for OL to return the flux : it's a quite long operation. That's why you should use the $reload_mode flag in microlibrary.pl to tell it to call the Data::CURL::CurlRequester or not. Once you have run it one time, rdf fluxes for lists and books are stored on your disk and it's not necessary to reload it each time you refresh your microlibrary page.
See the documentation for the OL API here http://openlibrary.org/dev/docs/restful_api.
We have a hardcoded parameter into build_the_list_request()
subroutine.
Feel free to change the name of your OL user.
my $request = "http://openlibrary.org/people/name_of_my_OL_user/lists/$_.rdf";
Net::Curl::Simple
Takes a list ids array as an argument. Build requests that are URI, contening an user name (hardcoded) and an id from the array. This subroutine is bad-named, cause she calls the send_the_list_request() subroutine and returns an hash or rdf fluxes, where keys are the key are the OL list id and the value an RDF flux.
Send the request to Open Library API. Receive and returns the RDF fluxus to build_the_list_request(). This is a conception problem that we need to fix.
Receive the request from the Data::RDF::RDFTool and returns it too. Could test the OL server status code returned.
An array containing all the lists ids of an OL user.
The request to send is the value found in the list RDF flux. For each "seed" you've got a value corresponding to the URI of a book
https://bugs.launchpad.net/bibliothek-project/+bug/856368 send_the_list_request() receive and returns the RDF fluxus to build_the_list_request(). This is a conception problem that we need to fix. Errors can be made cause build_the_list_request() don't do the job we can exept according to it's name.
It would be very smart to test the status code returned. https://blueprints.launchpad.net/bibliothek-project/+spec/daas2-ol-http-status-code http://openlibrary.org/dev/docs/restful_api#status_codes
We would like to make it asynchronous, so you don't have to wait for OL to return it's response to send another request.
At this 0.01 version, our Microlibrary is mono-library, so the name of the OL account is hard-coded into our module. It should be done otherwise (parsed from a properties file or taken into a database) and it will (multi-libraries). We will use a $OL_user scalar that will make possible to generate user-related requests.
Self Shelf Swap - Simon Foutaiz - 2011-05-19
my ( $firstname = "seb", $lastname = "feugere", $provider = "gmail"); print $firstname . "." . $lastname . "@" . $provider . "." .com;
This is version 0.01, well known as a Dime And A Shoestring
Copyright 2011 Self Shelf Swap.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl himself.