WordPress::Base::Content
use WordPress::Base::Content 'all'; use WordPress::XMLRPC; my $wp = new WordPress::XMLRPC({ proxy => 'http://mysite/xmlrpc.php', username => 'leo', password => 'pazz', }); my $struct = abs_path_to_media_object_data('/home/my/picture.jpg'); my $result = $wp->newMediaObject($struct) or die( $wp->errstr ); print STDERR "uploaded to ". $result->{url};
This is for dealing with files, slurping, cleaning up text, whatever. Nothing is exported by default.
Arg is abs path, turns into data structure expected as arg to upload with WordPress::XMLRPC methods. You would normally use a binary file for this.
Argument is a path. Returns filename part.
Argument is abs path, returns file bits in MIME::Base64
Argument is abs path, returns mime type
File::Type MIME::Base64
File::Type MIME::Base64 WordPress::API WordPress::XMLRPC
Leo Charre leocharre at cpan dot 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.