use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Object\Image;
+use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Network;
require_once 'mod/share.php';
require_once 'mod/parse_url.php';
}
function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
- require_once("include/items.php");
- require_once("include/network.php");
+ require_once 'include/items.php';
$post = "";
$quote = "";
switch($attachment->objectType) {
case "video":
$pagedata["type"] = "video";
- $pagedata["url"] = original_url($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
break;
case "article":
$pagedata["type"] = "link";
- $pagedata["url"] = original_url($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
break;
case "photo-album":
- $pagedata["url"] = original_url($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
case "album":
$pagedata["type"] = "link";
- $pagedata["url"] = original_url($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$thumb = $attachment->thumbnails[0];
break;
case "audio":
- $pagedata["url"] = original_url($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
break;
$account = PConfig::get($uid,'fromgplus','account');
$key = Config::get('fromgplus','key');
- $result = fetch_url("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch);
+ $result = Network::fetchUrl("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch);
//$result = file_get_contents("google.txt");
//file_put_contents("google.txt", $result);
if (function_exists("share_header"))
$post .= share_header($item->object->actor->displayName, $item->object->actor->url,
$item->object->actor->image->url, "",
- datetime_convert('UTC','UTC',$item->object->published),$item->object->url);
+ DateTimeFormat::utc($item->object->published),$item->object->url);
else
$post .= "[share author='".str_replace("'", "'",$item->object->actor->displayName).
"' profile='".$item->object->actor->url.
"' avatar='".$item->object->actor->image->url.
- "' posted='".datetime_convert('UTC','UTC',$item->object->published).
+ "' posted='".DateTimeFormat::utc($item->object->published).
"' link='".$item->object->url."']";
$post .= fromgplus_html2bbcode($item->object->content);