From a43f2041d3c4315dfc582a4aaff4e399f5453c89 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 15 May 2014 23:20:11 +0200 Subject: [PATCH 1/2] pump.io: Mirroring looked for the wrong date. Thanks to sazius for finding this. --- pumpio/pumpio.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 367879e61..f39bfef95 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -678,11 +678,11 @@ function pumpio_fetchtimeline(&$a, $uid) { if (count($posts)) { foreach ($posts as $post) { - if ($post->generator->published <= $initiallastdate) + if ($post->published <= $initiallastdate) continue; - if ($lastdate < $post->generator->published) - $lastdate = $post->generator->published; + if ($lastdate < $post->published) + $lastdate = $post->published; if ($first_time) continue; From 1d340dce464f220e3a5ea17aab23c43bbab374be Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 15 May 2014 23:21:39 +0200 Subject: [PATCH 2/2] fromgplus: Albums are now posts with a link to the album - not a collection of photos anymore. --- fromgplus/fromgplus.php | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 7b25fd3d2..27479abf7 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -257,28 +257,16 @@ function fromgplus_handleattachments($item, $displaytext) { foreach ($item->object->attachments as $attachment) { switch($attachment->objectType) { case "video": - $post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n"; - - /*$images = cleanupgoogleproxy($attachment->fullImage, $attachment->image); - if ($images["preview"] != "") - $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n"; - elseif ($images["full"] != "") - $post .= "\n[img]".$images["full"]."[/img]\n";*/ - + $post .= "\n[class=type-video][bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n[/class]"; break; case "article": $post .= "\n[class=type-link][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"] != "") - // $post .= "\n[img]".$images["full"]."[/img]\n"; if ($images["full"] != "") $post .= "\n[img]".$images["full"]."[/img]"; - //$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]"; $quote = trim(fromgplus_html2bbcode($attachment->content)); if ($quote != "") $quote = "\n[quote]".$quote."[/quote]"; @@ -309,13 +297,23 @@ function fromgplus_handleattachments($item, $displaytext) { break; case "album": - foreach($attachment->thumbnails as $thumb) { - $preview = "/w".$thumb->image->width."-h".$thumb->image->height."/"; - $preview2 = "/w".$thumb->image->width."-h".$thumb->image->height."-p/"; - $image = str_replace(array($preview, $preview2), array("/", "/"), $thumb->image->url); + $post .= "\n[class=type-link][bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]"; - $post .= "\n[url=".$thumb->url."][img]".$image."[/img][/url]\n"; - } + $thumb = $attachment->thumbnails[0]; + $post .= "\n[img]".$thumb->image->url."[/img]"; + + $quote = trim(fromgplus_html2bbcode($thumb->description)); + if ($quote != "") + $quote = "\n[quote]".$quote."[/quote]"; + + //foreach($attachment->thumbnails as $thumb) { + // $preview = "/w".$thumb->image->width."-h".$thumb->image->height."/"; + // $preview2 = "/w".$thumb->image->width."-h".$thumb->image->height."-p/"; + // $image = str_replace(array($preview, $preview2), array("/", "/"), $thumb->image->url); + + // $post .= "\n[url=".$thumb->url."][img]".$image."[/img][/url]\n"; + //} + $quote .= "[/class]"; break; case "audio": $post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n"; @@ -338,6 +336,7 @@ function fromgplus_fetch($a, $uid) { $result = fetch_url("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch); //$result = file_get_contents("google.txt"); + //$result = file_get_contents("addon/fromgplus/album.txt"); //file_put_contents("google.txt", $result); $activities = json_decode($result);