findIdFromUrl($feedurl);
$l = OC_L10N::get('news');
if ($feedid === null) {
$feed = OCA\News\Utils::fetch($feedurl);
if ($feed !== null) {
$feedid = $feedmapper->save($feed, 0); //adds in the root folder
}
if($feed === null || !$feedid) {
echo $l->t('An error occurred');
} else {
echo $l->t('Nice! You have subcribed to ') . $feed->getTitle() . '.';
}
}
else {
echo $l->t('You had already subcribed to this feed!');
}
?>
Close this window