Playing nice with others
-
Upload
eric-mann -
Category
Technology
-
view
1.437 -
download
0
Transcript of Playing nice with others
![Page 1: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/1.jpg)
Playing Nice with OthersIntegrating WordPress with External APIs
Eric Mann @ericmann http://about.me/eamWordCamp Phoenix February 26, 2012
![Page 2: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/2.jpg)
Integrating WordPress with External APIs
• Background• Technologies in use• Available tools• Practical Examples• Questions
![Page 3: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/3.jpg)
BACKGROUND
![Page 4: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/4.jpg)
TECHNOLOGIES
![Page 5: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/5.jpg)
ReST
![Page 6: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/6.jpg)
XML-RPC
![Page 7: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/7.jpg)
JSON
![Page 8: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/8.jpg)
TOOLS
![Page 9: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/9.jpg)
WP_Httpwp_remote_post( $url, $args );wp_remote_get( $url, $args );wp_remote_head( $url, $args );wp_remote_request( $url, $args );
wp_remote_retrieve_body( $response );wp_remote_retrieve_header( $response, $header );wp_remote_retrieve_headers( $response );wp_remote_retrieve_response_code( $response );wp_remote_retrieve_response_message( $response );
![Page 10: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/10.jpg)
wp_xmlrpc_serveradd_filter( 'xmlrpc_methods', 'wcphx_add_method' );
function wcphx_add_method( $methods ) {$methods['wcphx.sayHello'] =
'wcphx_sayHello';return $methods;
}
function wcphx_sayHello( $args ) {return 'Hello!';
}
![Page 11: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/11.jpg)
EXAMPLES
![Page 12: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/12.jpg)
Twitter - ReST
GET http://search.twitter.com/search.json?q=%23wcphx&rpp=5&include_entities=false&result_type=recent
![Page 13: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/13.jpg)
Extending XMLRPC
add_filter( 'xmlrpc_methods', 'wcphx_add_method' );
![Page 14: Playing nice with others](https://reader035.fdocuments.in/reader035/viewer/2022070518/58e85e321a28ab007c8b4733/html5/thumbnails/14.jpg)
QUESTIONS?