现在的位置: 首页 > 程序设计> 正文
PHP 发送博文到百度空间
2013年05月19日 程序设计 暂无评论 ⁄ 被围观 4,570+

昨天,测试了PHP方式登录百度空间,可以参见博文《PHP 登录百度空间》,今天通过抓包工具的分析,分析了博文的发布过程,实现了博文的自动发布。

参照代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
private function postArticle($baiduzoneurl, $title, $content, $category, $blogpower)
{
$post_data = array();
$post_data["title"] = $title;
$post_data["tags[]"] = $category;
$post_data["content"] = $content;
$post_data["private"] = $blogpower == 0? "" : "1";
$post_data["imgnum"] = "0";
$post_data["bdstoken"] = $this->bdstoken;
$post_data["qbid"] = "";
$post_data["refer"] = "http://hi.baidu.com/home";
$post_data["multimedia[]"] = "";
$post_data["private1"] = $post_data["private"];
$post_data["synflag"] = "";
$post_data["qing_request_source"] = "new_request";
 
$this->doHttpPost("http://hi.baidu.com/pub/submit/createtext", $post_data, "http://hi.baidu.com/pub/show/createtext");
}
private function postArticle($baiduzoneurl, $title, $content, $category, $blogpower)
{
$post_data = array();
$post_data["title"] = $title;
$post_data["tags[]"] = $category;
$post_data["content"] = $content;
$post_data["private"] = $blogpower == 0? "" : "1";
$post_data["imgnum"] = "0";
$post_data["bdstoken"] = $this->bdstoken;
$post_data["qbid"] = "";
$post_data["refer"] = "http://hi.baidu.com/home";
$post_data["multimedia[]"] = "";
$post_data["private1"] = $post_data["private"];
$post_data["synflag"] = "";
$post_data["qing_request_source"] = "new_request";

$this->doHttpPost("http://hi.baidu.com/pub/submit/createtext", $post_data, "http://hi.baidu.com/pub/show/createtext");
}

接下来再进行wordpress插件的更新,哈哈,这个就快多了!!!

目前有 0 条留言 其中:访客:2 条, 博主:0 条

  1. ITGeeker : 2013年05月20日13:33:48  -49楼 @回复 回复

    什么时候出wordpress的更新插件啊?

    • jiafa : 2013年08月10日19:20:46 @回复 回复

      @周润生: 插件又不能用了。

给我留言

留言无头像?


×
腾讯微博