thenbrent/social-connect — Issue #14: Implementing WP_Http
Author: rmathis
Created: 2012-02-08 22:09:33+00:00
State: open

In order to get around a proxy server and allow SC to work, I implemented a change in the utils.php.

I would highly recommend you include this in a future release, as it uses Wordpress' built-in http request object instead of curl, which also allows you to define Proxy constants in wp-config.php to use proxy servers.

function sc_curl_get_contents( $url ) {
/*
$curl = curl_init();
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );

curl_close( $curl );
*/

if( !class_exists( 'WP_Http' ) )
include_once( ABSPATH . WPINC. '/class-http.php' );

$request = new WP_Http;
$result = $request->request( $url );
$html = $result['body'];

return $html;
}

Thanks,
Ryan Mathis