WebService::FileCloud - filecloud.io WebService API
use WebService::FileCloud; $websvc = WebService::FileCloud->new( akey => 'apikey', username => 'username', password => 'password' ); $result = $websvc->fetch_apikey(); # you should check for HTTP request / usage errors first if ( !$result ) { die( $websvc->error() ); } # check for filecloud.io errors in response if ( $result->{'status'} eq 'error' ) { die( $result->{'message'} ); } $akey = $result->{'akey'};
WebService::FileCloud is a module to communicate with the http://filecloud.io API. Documentation for their API is available at https://code.google.com/p/filecloud/.
Creates a new WebService::FileCloud object with the arguments given. All arguments are optional, but may be required depending upon the API methods executed.
The API key provided to your account by filecloud.io. This can be determined via the fetch_apikey() method if you provided your username and password of the account. Many methods require this argument to be specified.
The username for your account. The only method that requires this is fetch_apikey(). Must also be provided with password.
The password for your account. The only method that requires this is fetch_apikey(). Must also be provided with username.
All methods will return a false value if they were called incorrectly (missing required parameters), or if there was an HTTP or other internal error issuing the request. Use the error() method to get an error message as to why it failed. Otherwise, they should return a JSON-decoded hashref as is directly from filecloud.io (which may also contain an error).
Returns the API key associated to the account. Both the username and password options must be given in the constructor.
Returns the details of the account. The akey option must be given in the constructor to execute this method.
Determines if the filecloud.io API is operational. No arguments are necessary in the constructor to execute this method.
Returns a URL to use when uploading a file. No arguments are necessary in the constructor to execute this method.
Determines if a file is available and returns basic information. No arguments are necessary in the constructor to execute this method, but the ukey option must be provided to this method.
The unique key of the file. This argument is required.
Returns the full details for a particular file. The akey option must be given in the constructor, and the ukey option described below must be provided to this method.
Returns the URL to use in order to download the specified file. The akey option must be given in the constructor, and the ukey option described below must be provided to this method.
Uploads a file to the URL specified. The upload url can be determined via the fetch_upload_url() method. The akey option must be given in the constructor, and the filename and url options described below must be provided to this method.
The location of the file to upload. This argument is required.
The URL to upload the file to. This argument is required.
Returns the details of the tag specified. The akey option must be given in the constructor, and the tkey option described below must be provided to this method.
The unique key of the tag. This argument is required.
Returns an error string for the last error encountered. This only contains internal errors related to HTTP requests and not errors from the filecloud.io API itself.
LWP::UserAgent, JSON
http://filecloud.io and https://code.google.com/p/filecloud/
Mitch McCracken <mrmccrac@gmail.com>
To install WebService::FileCloud, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::FileCloud
CPAN shell
perl -MCPAN -e shell install WebService::FileCloud
For more information on module installation, please visit the detailed CPAN module installation guide.