[技术学习]利用CPAN模块WordPress::XMLRPC写了个提交博客的Perl脚本
#! /usr/bin/perl# 关于CPAN的配置,简之言之:
# 我没配置,全部回车走默认设置。然后在cpan命令行中输入install WordPress::XMLRPC
use WordPress::XMLRPC;
my$o= WordPress::XMLRPC->new({
username => 'thinkhy', # 用户名
password => '123456789', # 密码
proxy => 'http://www.disandu.com/xmlrpc.php',}); # xmlrpc服务地址
$content_hashref->{title} = 'Perl CPAN WordPress::XMLRPC DEMO'; # 文章标题
$content_hashref->{categories} = ['开源软件', 'perl'];# 分类目录
$content_hashref->{description} = "Hello,CPAN!";# 文章内容,注意转义"(/")和$(/$)
$o->newPost($content_hashref, 1);
print"I am Here";
页:
[1]