WordPress::API::MediaObject
use WordPress::API::MediaObject;
my $o = WordPress::API::MediaObject->new({ proxy => 'http://site.com/xmlrpc.php', username => 'tito', password => 'yup', });
$o->load_file('/path/to/media/file.jpg');
$o->upload;
$o->url;
arg is hash ref, keys are proxy, username, password you can also pass server insetead, which is an XMLRPC::Simple object
optional argument is abs path to media file returns boolean this is what encodes your file to bits, set the meme type, etc if no argument is passed, abs_path() must have been set
returns the bits if you called load_file()
returns mime type if you called load_file()
returns filename if you called load_file()
returns the abs path of the media file
makes sure file is on disk
returns struct that will be sent to wordpress via xmlrpc, see WordPress::Base::Data::Object
uploads the data returns url
will return url via which object can be reached via http call after upload()
WordPress::XMLRPC
Leo Charre leocharre at cpan for org
To install WordPress::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WordPress::API
CPAN shell
perl -MCPAN -e shell install WordPress::API
For more information on module installation, please visit the detailed CPAN module installation guide.