+ $uriid = ItemURI::insert(['uri' => $arr['url'], 'guid' => $arr['guid']]);
+
+ $contact = Contact::getByUriId($uriid, ['id']);
+ if (!empty($contact['id'])) {
+ $last_interaction = DateTimeFormat::utc('now - 180 days');
+
+ $interacted = DBA::count('contact-relation', ["`cid` = ? AND NOT `follows` AND `last-interaction` > ?", $contact['id'], $last_interaction]);
+ $interacting = DBA::count('contact-relation', ["`relation-cid` = ? AND NOT `follows` AND `last-interaction` > ?", $contact['id'], $last_interaction]);
+ $posts = Post::countPosts(['author-id' => $contact['id'], 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]);
+ }
+