Something is wrong with your CURL function. This is what I tried and it works:
wp-autosocial.php; find “autosocial_graph” for the reference point:
function curl_get_contents ($url) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$html = curl_exec($curl);
curl_close($curl);
return $html;
}
function autosocial_graph($url, $fields = array()) {
// function to get facebook graph api results
//$output = file_get_contents($url);
//$output = makeRequest($url, $fields);
$output = curl_get_contents($url);
return $output;
}
But if I use makeRequest, then the call fails:
function autosocial_graph($url, $fields = array()) {
// function to get facebook graph api results
//$output = file_get_contents($url);
$output = makeRequest($url, $fields);
//$output = curl_get_contents($url);
return $output;
}
You’re also still using file_get_contents for the Bit.ly function:
function autosocial_bitly($post_ID = 0, $link = '') {
... some code here ...
$bitly = json_decode(@file_get_contents('https://api.bit.ly/shorten?version=2.0.1&login='.$login.'&apiKey='.$api_key.'&longUrl='.$bl_link.'&history=1'));
I can’t figure out what’s wrong and I’d rather not use my crude hack. Could you take a look at it and update? Thanks!