From: Michael Vogel Date: Mon, 21 Jul 2014 22:38:52 +0000 (+0200) Subject: fromgplus: Don't post posting that are too young. It could happen that the picture... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=418ce62d7b974c691c37660d523fda00c7afa640;p=friendica-addons.git fromgplus: Don't post posting that are too young. It could happen that the picture upload isn't finished, when the post is being fetched. --- diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 137b2940..9699ba9b 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -391,6 +391,12 @@ function fromgplus_fetch($a, $uid) { if (strtotime($item->published) <= $initiallastdate) continue; + // Don't publish items that are too young + if (strtotime($item->published) > (time() - 3*60)) { + logger('fromgplus_fetch: item too new '.$item->published); + continue; + } + if ($lastdate < strtotime($item->published)) $lastdate = strtotime($item->published);