Remotely fetches the RSS feed and updates it.
Note that if the remote feed specifies a TTL, trying to update before the ttl will result in feed_is_recent error
@param int $downloadFeedId
@return bool
760518
public function refreshFeed($downloadFeedId){
        $service = sprintf( self::API_DOWNLOAD_FEEDS_ITEM_FETCH, $downloadFeedId);
        $rest = $this->getService( $service);
        $rest->POST();

        return $rest->getSuccess();
    }
144445
def feed_fetch_force(request, id, redirect_to):
    """"""
    feed = Feed.objects.get(id=id)
    feed.fetch(force=True)
    msg = _("Fetched tweets for %s" % feed.name)
    messages.success(request, msg, fail_silently=True)
    return HttpResponseRedirect(redirect_to)
1281741
public function emptyBlackListFromDownloadId( $downloadTaskId) {
        $service = sprintf( self::API_DOWNLOAD_ITEM_BLACKLIST_EMPTY, $downloadTaskId);
        $rest = $this->getService( $service);
        $rest->DELETE();

        return $rest->getSuccess();
    }
423766
protected function fetch_feed(string $url) : \moodle_simplepie {
        // Fetch the rss feed, using standard simplepie caching so feeds will be renewed only if cache has expired.
        \core_php_time_limit::raise(60);

        $feed = new \moodle_simplepie();

        // Set timeout for longer than normal to be agressive at fetching feeds if possible..
        $feed->set_timeout(40);
        $feed->set_cache_duration(0);
        $feed->set_feed_url($url);
        $feed->init();

        return $feed;
    }
4732
public function mustBeKept($tweetId)
    {
        if (count($this->getRetweetingStatuses()) == 0) {
            // This tweet has not been retweeted
            return false;
        }

        // Check that this tweet has not been retweeted after $tweetId
        foreach ($this->getRetweetingStatuses() as $retweeting_status) {
            // This tweet is retweeted in the timeline, keep it
            if ($retweeting_status->getId() >= $tweetId) {
                return true;
            }
        }

        return false;
    }
1373570
public function getFromId($download_id)
    {
        $result = $this->callService('GET', self::API_DOWNLOAD . $download_id);

        return $result->getModel(models\Download\Task::class);
    }
264072
public function updateFeed(models\Download\Feed\DownloadFeed $downloadFeed)
    {
        $service = sprintf(self::API_DOWNLOAD_FEEDS_ITEM, $downloadFeed->getId());
        $rest    = $this->callService('PUT', $service, $downloadFeed);

        return $rest->getModel(models\Download\Feed\DownloadFeed::class);
    }
19208
public static function getAttachment($attachmentID,$options = [])
    {
        $result     = null;
        $downloader = new Priloha($attachmentID,$options);
        if ($downloader->lastResponseCode == 200) {

            $downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
            if ($downloader->lastResponseCode == 200) {
                $result = $downloader->lastCurlResponse;
            }
        }
        return $result;
    }
167534
public function removeFeed( $downloadFeedId){
        $service = sprintf( self::API_DOWNLOAD_FEEDS_ITEM, $downloadFeedId);
        $rest = $this->getService( $service);
        $rest->DELETE();

        return $rest->getSuccess();
    }
96373
public function getLogFromId( $download_id){
        $logService = sprintf( self::API_DOWNLOAD_LOG, $download_id);
        $rest = $this->getService( $logService);
        $rest->GET();

        return $rest->getResult();
    }
1017884
public function linkToPageRSSFeed()
    {
        if (!Config::inst()->get(VersionFeed::class, 'changes_enabled') || !$this->owner->PublicHistory) {
            return;
        }
        
        RSSFeed::linkToFeed(
            $this->owner->Link('changes'),
            _t(
                'SilverStripe\\VersionFeed\\VersionFeed.SINGLEPAGEFEEDTITLE',
                'Updates to {title} page',
                ['title' => $this->owner->Title]
            )
        );
    }
772887
public function renderFeedBlockAction($feedUrl, $offset = 0, $limit = 5)
    {
        $response = new Response();
        try {
            // Keep response in cache. TTL is configured in default_settings.yml
            $response->setSharedMaxAge($this->container->getParameter('ezdemo.cache.feed_reader_ttl'));

            return $this->render(
                'eZDemoBundle:frontpage:feed_block.html.twig',
                array(
                    'feed' => ezcFeed::parse($feedUrl),
                    'offset' => $offset,
                    'limit' => $limit,
                ),
                $response
            );
        }
        // In the case of exception raised in ezcFeed, return the empty response to fail nicely.
        catch (Exception $e) {
            $this->get('logger')->error("An exception has been raised when fetching RSS feed: {$e->getMessage()}");

            return $response;
        }
    }
396820
public function getDataFeed($uri = self::ANALYTICS_FEED_URI)
    {
        if ($uri instanceof Query) {
            $uri = $uri->getQueryUrl();
        }
        return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed');
    }
1090538
function getFeed(url, callback) {
  getXmlString(url).then(xmlStringToJSON).then(callback).catch(callback);
}
577621
public function update($version = '', $forceFetching = true) : bool
    {
        $version = $version ?: $this->getVersionAvailable();

        if ($forceFetching) {
            $this->fetch($version);
        }

        $this->preUpdateArtisanCommands();
        $updateStatus = $this->sourceRepository->update($version);
        $this->postUpdateArtisanCommands();

        return $updateStatus;
    }
892662
public function eraseFromId($download_id)
    {
        $eraseService = sprintf(self::API_DOWNLOAD_ERASE, $download_id);
        $rest         = $this->callService('DELETE', $eraseService);

        return $rest->getSuccess();
    }
1905
protected function cron_has_fresh_fetch($now) {
        $recent = $this->get_last_timefetched();

        if (empty($recent)) {
            return false;
        }

        if ($now < $recent) {
            $this->cron_mtrace('The most recent fetch is reported to be in the future, this is weird!');
            return true;
        }

        if ($now - $recent > 24 * HOURSECS) {
            return false;
        }

        return true;
    }