$post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n";
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
- if ($images["preview"] != "")
- $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
- elseif ($images["full"] != "")
+ //if ($images["preview"] != "")
+ // $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
+ //elseif ($images["full"] != "")
+ // $post .= "\n[img]".$images["full"]."[/img]\n";
+ if ($images["full"] != "")
$post .= "\n[img]".$images["full"]."[/img]\n";
//$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]";
$result = $tweet->post('statuses/update_with_media', array('media[]' => "{$img_str};type=".$mime.";filename={$filename}" , 'status' => $msg));
logger('twitter_post_with_media send, result: ' . print_r($result, true), LOGGER_DEBUG);
- if ($result->error) {
- logger('Send to Twitter failed: "' . $result->error . '"');
+ if ($result->errors OR $result->error) {
+ logger('Send to Twitter failed: "' . $result->errors . '"');
// Workaround: Remove the picture link so that the post can be reposted without it
$image = "";
}
if(strlen($msg) and ($image == "")) {
$result = $tweet->post('statuses/update', array('status' => $msg));
logger('twitter_post send, result: ' . print_r($result, true), LOGGER_DEBUG);
- if ($result->error)
- logger('Send to Twitter failed: "' . $result->error . '"');
+ if ($result->errors OR $result->error)
+ logger('Send to Twitter failed: "' . $result->errors . '"');
}
}
}