NAME

WordPress::Base::Content

SYNOPSIS

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};

DESCRIPTION

This is for dealing with files, slurping, cleaning up text, whatever. Nothing is exported by default.

SUBS

abs_path_to_media_object_data()

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.

get_file_name()

Argument is a path. Returns filename part.

get_file_bits()

Argument is abs path, returns file bits in MIME::Base64

get_mime_type()

Argument is abs path, returns mime type

REQUIREMENTS

File::Type MIME::Base64

SEE ALSO

File::Type MIME::Base64 WordPress::API WordPress::XMLRPC

AUTHOR

Leo Charre leocharre at cpan dot org