Renders an RSS feed into HTML.
Response is cached for 1 hour.

@param string $feedUrl
@param int $offset
@param int $limit

@return Response
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;
        }
    }
1197495
public function limit($limit, $offset = null)
    {
        $this->_limit = $limit > 0 ? (int)$limit : null;
        $this->_offset = $offset > 0 ? (int)$offset : null;

        return $this;
    }
570924
public function setOffsetLimit($offset, $limit)
    {
        $this->offset = $offset;
        $this->limit = $limit;
        $this->paginationType = self::OFFSET_LIMIT_PAGINATION;
    }
1284975
def getFeedContent(self, feed, excludeRead=False, continuation=None, loadLimit=20, since=None, until=None):
        
        return self._getFeedContent(feed.fetchUrl, excludeRead, continuation, loadLimit, since, until)
1106846
def get_rss_feed_content(url, offset=0, limit=None, exclude_items_in=None):
    

    end = limit + offset if limit is not None else None

    response = _get(url)

    try:
        feed_data = feedparser.parse(response.text)
        if not feed_data.feed:
            logger.warning('No valid feed data found at {}'.format(url))
            return False
        content = feed_data.entries
    except Exception as parse_error:
        logger.warning(
            'Failed to parse feed from {}: {}'.format(url, str(parse_error))
        )
        return False

    if exclude_items_in:
        exclude_ids = [item['guid'] for item in exclude_items_in]
        content = [item for item in content if item['guid'] not in exclude_ids]

    content = content[offset:end]

    for item in content:
        updated_time = time.mktime(item['updated_parsed'])
        item['updated_datetime'] = datetime.fromtimestamp(updated_time)

    return content
170338
public function read( $offset = NULL, $limit = NULL )
	{
		return $this->load( $this->fileName, $offset, $limit );
	}
27564
public function getTimes($limit = 100, $offset = 0)
    {
        /** @var TimeFbApi $response */
        $response = $this->call(new Request('time.get', array(), $limit, $offset), 'DVelopment\FastBill\Model\TimeFbApi');

        return $response->getResponse()->getTimes();
    }
265405
public function getArticles($limit = 100, $offset = 0)
    {
        /** @var ArticleFbApi $response */
        $response = $this->call(new Request('article.get', array(), $limit, $offset), 'DVelopment\FastBill\Model\ArticleFbApi');

        return $response->getResponse()->getArticles();
    }
1321420
public function pagination(int $limit = 20, int $offset = 0, ?callable $totalQuery = null)
    {
        $query = clone $this->selectQueryInstance();

        return $query->paginate($limit, $offset, $totalQuery);
    }
410392
public function withOffsetLimit($offset, $limit)
    {
        $new = clone $this;
        $new->offset = $offset;
        $new->limit = $limit;
        $new->paginationType = self::OFFSET_LIMIT_PAGINATION;

        return $new;
    }
651825
public function prepareLimit($limit = null, $offset = null)
    {
        //wyjście jeśli brak limitu
        if (!($limit > 0)) {
            return;
        }
        //limit z offsetem
        if ($offset > 0) {
            return 'LIMIT ' . intval($offset) . ', ' . intval($limit);
        }
        //sam limit
        return 'LIMIT ' . intval($limit);
    }
1288178
public function getPublicationAction(Request $request, $feed_id)
    {
        $user = $this->getAuthenticatedUser();
        /** @var FeedRepository $repository */
        $repository = $this->app['repo.feeds'];
        /** @var Feed $feed */
        $feed = $repository->find($feed_id);

        if (!$feed->isAccessible($user, $this->app)) {
            return Result::create($request, [])->createResponse();
        }

        $offset_start = (int) $request->get('offset_start', 0);
        $per_page = (int) $request->get('per_page', 5);

        $per_page = (($per_page >= 1) && ($per_page <= 100)) ? $per_page : 100;

        $data = [
            'feed'         => $this->listPublication($feed, $user),
            'offset_start' => $offset_start,
            'per_page'     => $per_page,
            'entries'      => $this->listPublicationsEntries($request, $feed, $offset_start, $per_page),
        ];

        return Result::create($request, $data)->createResponse();
    }
354515
public function getActivities($offset = 0, $limit = 20, $options = [], $enrich=false, $reactions = null)
    {
        if($options === null){
            $options = [];
        }
        $query_params = ['offset' => $offset, 'limit' => $limit];
        if (array_key_exists('mark_read', $options) && is_array($options['mark_read'])) {
            $options['mark_read'] = implode(',', $options['mark_read']);
        }
        if (array_key_exists('mark_seen', $options) && is_array($options['mark_seen'])) {
            $options['mark_seen'] = implode(',', $options['mark_seen']);
        }
        $query_params = array_merge($query_params, $options);

        if($reactions !== null){
            if(!is_array($reactions)){
                throw new StreamFeedException("reactions argument should be an associative array");
            }
            if(isset($reactions["own"]) && $reactions["own"]){
                $query_params["withOwnReactions"] = true;
                $enrich = true;
            }
            if(isset($reactions["recent"]) && $reactions["recent"]){
                $query_params["withRecentReactions"] = true;
                $enrich = true;
            }
            if(isset($reactions["counts"]) && $reactions["counts"]){
                $query_params["withReactionCounts"] = true;
                $enrich = true;
            }
        }

        $prefix_enrich = $enrich ? 'enrich/' : '';

        return $this->makeHttpRequest("{$prefix_enrich}{$this->base_feed_url}/", 'GET', null, $query_params, 'feed', 'read');
    }
210175
public function tagsList($limit = 25, $offset = 0)
    {
        $resource = '/tags.json';

        // Create request
        $data = $this->auth->request(
            'GET',
            $resource,
            array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
        );

        return $data;
    }
1284811
public function prepareLimit($limit, $offset = null)
    {
        if ($offset) {
            $this->setLimit = ' LIMIT ' . $limit . ', ' . $offset . '';
        } else {
            $this->setLimit = ' LIMIT ' . $limit . '';
        }

        return $this;
    }
76491
protected function createStreamResponse(array $options, string $format, FeedContentProviderInterface $provider, FeedIo $feedIo) : Response
    {
        $content = $this->getContent($options, $provider);

        if ($this->mustForceRefresh() || $content->getLastModified() > $this->getModifiedSince()) {
            $response = new Response($feedIo->format($content, $format));
            $this->setFeedHeaders($response, $content, $format);

        } else {
            $response = new Response();
            $response->setNotModified();
        }

        return $response;
    }
1185919
private function addPagination($qb, $offset, $limit)
    {
        // Add pagination
        $qb->setFirstResult($offset);
        $qb->setMaxResults($limit);

        return $qb;
    }