From 418ce62d7b974c691c37660d523fda00c7afa640 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 22 Jul 2014 00:38:52 +0200 Subject: [PATCH] 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. --- fromgplus/fromgplus.php | 6 ++++++ 1 file changed, 6 insertions(+) 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);