David Ansermot Web Developer / TYPO3 Integrator

22oct/100

PHP – Remote post on WordPress using cUrl

Here's a code snippet function for remote posting on WordPress blogs I've made for my usage. It use XML-RPC and cUrl to publish on your blog.
Hope it'll help you.

  1. < ?php
  2.  
  3. /**
  4. * Remote post on WordPress function
  5. *
  6. * @date 2010-10-22
  7. * @author David Ansermot
  8. * @url http://v2.ansermot.ch
  9. *
  10. * @param string $url: Your blog's url
  11. * @param string $login: Your blog's login
  12. * @param string $pass: Your blog's password
  13. * @param string $postTitle: The post's title
  14. * @param string $postCats: A comma separated list of categories's ids
  15. * @param string $postContent: The post's content
  16. * @return bool
  17. */
  18. function curlRemotePostToWordPress($url, $login, $pass, $postTitle, $postCats, $postContent) {
  19.  
  20. // Remote post url
  21. $rpcUrl = rtrim($url, '/').'/xmlrpc.php';
  22.  
  23. // Categories for the post
  24. $categories = explode(',', $postCats);
  25.  
  26. // Post xml
  27. $xml = ''.$postTitle.'
  28.  
  29. < ![CDATA[ '.$postContent.' ] ]>';
  30.  
  31. // Build request
  32. $params = array('', '', $login, $pass, $xml, 1);
  33. $request = xmlrpc_encode_request('blogger.newPost', $params);
  34.  
  35. // Send the request
  36. try {
  37.  
  38. $ch = curl_init();
  39.  
  40. // cUrl configuration
  41. curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
  42. curl_setopt($ch, CURLOPT_URL, $rpcUrl);
  43. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  44. curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  45.  
  46. // Execution
  47. curl_exec($ch);
  48.  
  49. return true;
  50.  
  51. } catch (Exception $e) {
  52.  
  53. return false;
  54.  
  55. }
  56. }
  57.  
  58. ?>
21juin/100

Joomla 1.6 Beta 3!

The Joomla Project is proud to announce the immediate availability of Joomla 1.6 beta 3 (download). IMPORTANT NOTE: This is a beta version and is not intended to run any type of production site. It is intended to be used for evaluation purposes only.

Since the Joomla 1.6 beta 2 release on May 31, we have fixed approximately 102 issues in the tracker. Much of this progress is directly related to the stepped up efforts of the Joomla! Bug Squad. Thanks for all your hard work in bringing us one increment closer to stable!

See the CHANGELOG for details of what has been changed in this release.

What's next?

This is the third in our series of continuous betas. Beta 4 will be released on June 28, 2010.

Download it
Official post

3juin/100

WP.com : Your Public Profile

Back in March when we announced Gravatar-powered profiles on WordPress.com, your profile page remained private so that only you could access it. Now that you’ve had a chance to update your information and make sure that only details you want public are there, let’s open things up. It’s been just over 2 months and more than 300,000 people have updated their details so it’s time to do what we’ve been really excited to do since we first announced profiles:

Read the full post here

2juin/100

We All Like to Reblog

Have you ever come across a blog post that you enjoyed so much you wanted to easily share it with the readers of your own blog? Sure, you can copy and paste the link and perhaps even a snippet of text with your own comments, but overall it’s not a particularly enjoyable experience. We wanted to change this and make sharing other posts with your readers as easy as posting to your blog.

Read more...

31mai/100

WordPress new Theme : Paperpunch

A new theme as been released for WordPress. It's named "Paperpunch"

Read full post
Download theme