It seems that neither did the Akismet guys until an update was made to the plugin a few days back.PHP Code:Also, I didnt even know about wp_remote_retrieve_body. Seriously.
Jacob Santos told me use it once when I was whining via Skype about how some people couldn't get a plugin of mine to work due to their server setups not accepting the http request. As soon as I switched to the built in http API everything worked seamlessly :) There was very little documentation available at the time, but I've noticed a few blog posts about it here and there since then so should be a bit easier to figure out now (I only nutted it out with the help of Jacob himself).
I went fishing around in some old code of mine and pulled this up. It should allow you to grab the page contents of the URL as a string from wherever you want. If you need to parse that as PHP you would need to use eval(). If you can sanitize it beforehand that would probably be a good idea as passing PHP directly between servers like that doesn't seem like a good idea to me due to the potential of some prat intercepting it enroute.
PHP Code:<?php $string = wp_remote_retrieve_body( wp_remote_get( $url ) ); ?>
EDIT: I went looking for more resources on this, but it seems there are still aren't very many. Ozh wrote an article, but it uses the class directly rather than making use of the wrapper functions which handle all the complex bits for you ... http://planetozh.com/blog/2009/08/ho...ith-wordpress/


LinkBack URL
About LinkBacks
Reply With Quote