NAME

WWW::Wordpress - Wordpress API interface .

SYNOPSIS

Usage:

   use WWW::Wordpress;
   $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
   my $wordpress = WWW::Wordpress->new( blog => 'blog.Wordpress.com',
					blog_id => '00000',
					access_token => 'XXXXX');					

DESCRIPTION

Wordpress API interface

FUNCTIONS

constructor

    my $wordpress = WWW::Wordpress->new( blog => 'blog.Wordpress.com',
					blog_id => '00000',
					access_token => 'XXXXX');	

To get your Access Token check

http://developer.Wordpress.com/docs/oauth2/#receiving-an-access-token

site_info

$site_info = $wordpress->site_info;
$post_count = $site_info->{post_count};
$subscribers_count = $site_info->{subscribers_count};
print "post_count $post_count \n";
print "subscribers_count $subscribers_count \n";

stats of the site.

post

$content = "this is my test body ";
$title = "new title";
$tags = "linux";
my $post_data = { content => $content,title => $title,tags => $tags };
$post_info = $wordpress->post(post_data => $post_data );
$id = $post_info->{id};
$URL = $post_info->{URL};
print "id $id URL $URL  \n";

Post an article

edit_post

$new_content = "Edited test";
$post_id = 19;

my $post_data = { content => $new_content};
$status = $wordpress->edit_post(post_data => $post_data, post_id => $post_id);
print "status $status \n";

Edit a post by post id

follow

my $post_data = { pretty => 1};
$status = $wordpress->follow(blog => 'blog.Wordpress.com',post_data => $post_data);  
print "status $status \n";

Follow another blog

unfollow

my $post_data = { pretty => 1};
$status = $wordpress->unfollow(blog => 'blog.Wordpress.com',post_data => $post_data);  
print "status $status \n";

Unfollow blog

dispatch

Internal function         
                 

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html