$cc->displayError($e->getMessage());
}
+$subDb = new Subscriptions();
+
$url = $res->args['url'];
$url = Helper::addSchema($url);
$urlObj = new \Net_URL2($url);
$url = $urlObj->getNormalizedURL();
if (!Helper::isUrlAllowed($url)) {
- Log::error("Domain is not allowed; not crawling");
+ Log::error("Domain is not allowed; not subscribing");
+ $subDb->remove($url);
exit(2);
}
-$subDb = new Subscriptions();
-
list($topic, $hub) = $subDb->detectHub($url);
if ($hub === null) {
Log::error('No hub URL found for topic');
$sub = $subDb->get($topic);
if ($sub === false) {
- $subDb->create($topic);
+ $subDb->create($topic, $hub);
} else {
Log::info(
'Topic exists already in subscription table with status '
);
Log::info('Renewing subscription...');
$subDb->renew($sub->sub_id);
+ $hub = $sub->sub_hub;
}
$sub = $subDb->get($topic);