安装php之xmlrpc

背景:

在osx系统(mac)上使用MAMP安装的PHP开发环境,一般没有xmlrpc.so扩展。

安装方法:

直接下载xmlrpc.so扩展文件,放入php的扩展目录中(一般为extensions/no-debug-non-zts-*/)。

下载链接:

链接一,http://www.mediafire.com/download/0ryh0x8fznhvv46/xmlrpc.so(或点此直接下载

链接二,http://sourceforge.net/projects/mamp/files/mamp/2.1.2/

结果:

屏幕快照 2015-02-02 下午4.10.06

【参考:】

http://stackoverflow.com/questions/2031564/php-xmlrpc-extension-and-mamp

wordpress之xmlrpc发布文章出现中文乱码的问题

问题:

使用xmlrpc远程发布wordpress文章时,中文会出现乱码。

解决方法:

函数xmlrpc_encode_request中指定编码格式。

示例代码:

【参考:】

https://wordpress.org/support/topic/problem-with-utf-8-in-xmlrpc_encode_request

http://stackoverflow.com/questions/12618668/encoding-issues-when-posting-custom-fields-via-wordpress-xmlrpc-api

wordpress之xmlrpc远程发布文章

介绍:

使用Wordpress自带的xmlrpc.php(wordpress/xmlrpc.php)可以实现远程PHP代码发布文章信息。

注意:

  1. 使用官方提供的最新的paramters参数信息
  2. 分类category的参数值信息使用双引号,而不是单引号。(有人指出,单引号可能会存在问题)

【参考:】

http://codex.wordpress.org/XML-RPC_Support

http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.newPost

http://codex.wordpress.org/Function_Reference/wp_insert_post

http://stackoverflow.com/questions/9221859/wordpress-post-via-xmlrpc-add-multiple-categories

http://stackoverflow.com/questions/12087648/wordpress-xml-rpc-post-to-a-specific-category

10 awesome things to do with cURL

cURL, and its PHP extension libcURL, are tools which can be used to simulate a web browser. In fact, it can for example, submit forms. In this article, I’m going to show you 10 incredible things that you can do using PHP and cURL.

Acknowledgments

New to cURL? If yes, check out the following articles to learn the purposes and basics of cURL/libcurl.

Please note that some of the techniques shown here can be used for “blackhat” methods. The goal of this article is only educationnal, please do not use any of the snippets below for illegal stuff. 继续阅读“10 awesome things to do with cURL”