Get page-specific changes in a RSS feed.
185245
public function changes()
    {
        // Check viewability of changes
        if (!Config::inst()->get(VersionFeed::class, 'changes_enabled')
            || !$this->owner->PublicHistory
            || $this->owner->Version == ''
        ) {
            return $this->owner->httpError(404, 'Page history not viewable');
        }

        // Cache the diffs to remove DOS possibility.
        $target = $this->owner;
        $key = implode('_', array('changes', $target->ID, $target->Version));
        $entries = $this->filterContent($key, function () use ($target) {
            return $target->getDiffList(null, Config::inst()->get(VersionFeed::class, 'changes_limit'));
        });

        // Generate the output.
        $title = _t(
            'SilverStripe\\VersionFeed\\VersionFeed.SINGLEPAGEFEEDTITLE',
            'Updates to {title} page',
            ['title' => $this->owner->Title]
        );
        $rss = new RSSFeed($entries, $this->owner->request->getURL(), $title, '', 'Title', '', null);
        $rss->setTemplate('Page_changes_rss');
        return $rss->outputToBrowser();
    }
37857
def page_context(request, site, **criterias):
	''
	try: page = int(request.GET.get('page', 1))
	except ValueError: page = 1

	feed, tag = criterias.get('feed'), criterias.get('tag')
	if feed:
		try: feed = models.Feed.objects.get(pk=feed)
		except ObjectDoesNotExist: raise Http404

	page = get_page(site, page=page, **criterias)
	subscribers = site.active_subscribers

	if site.show_tagcloud and page.object_list:
		from feedjack import fjcloud
		# This will hit the DB once per page instead of once for every post in
		#  a page. To take advantage of this the template designer must call
		#  the qtags property in every item, instead of the default tags property.
		user_obj, tag_obj = get_posts_tags(
			subscribers, page.object_list, feed, tag )
		tag_cloud = fjcloud.getcloud(site, feed and feed.id)
	else:
		tag_obj, tag_cloud = None, tuple()
		try:
			user_obj = models.Subscriber.objects\
				.get(site=site, feed=feed) if feed else None
		except ObjectDoesNotExist: raise Http404

	site_proc_tags = site.processing_tags.strip()
	if site_proc_tags != 'none':
		site_proc_tags = filter( None,
			map(op.methodcaller('strip'), site.processing_tags.split(',')) )
		# XXX: database hit that can be cached
		for site_feed, posts in it.groupby(page.object_list, key=op.attrgetter('feed')):
			proc = site_feed.processor_for_tags(site_proc_tags)
			if proc: proc.apply_overlay_to_posts(posts)

	ctx = dict(
		last_modified = max(it.imap(
				op.attrgetter('date_updated'), page.object_list ))\
			if len(page.object_list) else datetime(1970, 1, 1, 0, 0, 0, 0, timezone.utc),

		object_list = page.object_list,
		subscribers = subscribers.select_related('feed'),
		tag = tag_obj,
		tagcloud = tag_cloud,

		feed = feed,
		url_suffix = ''.join((
			'/feed/{0}'.format(feed.id) if feed else '',
			'/tag/{0}'.format(escape(tag)) if tag else '' )),

		p = page, # "page" is taken by legacy number
		p_10neighbors = OrderedDict(
			# OrderedDict of "num: exists" values
			# Use as "{% for p_num, p_exists in p_10neighbors.items|slice:"7:-7" %}"
			(p, p >= 1 and p <= page.paginator.num_pages)
			for p in ((page.number + n) for n in xrange(-10, 11)) ),

		## DEPRECATED:

		# Totally misnamed and inconsistent b/w user/user_obj,
		#  use "feed" and "subscribers" instead.
		user_id = feed and feed.id,
		user = user_obj,

		# Legacy flat pagination context, use "p" instead.
		is_paginated = page.paginator.num_pages > 1,
		results_per_page = site.posts_per_page,
		has_next = page.has_next(),
		has_previous = page.has_previous(),
		page = page.number,
		next = page.number + 1,
		previous = page.number - 1,
		pages = page.paginator.num_pages,
		hits = page.paginator.count )

	get_extra_context(site, ctx)

	return ctx
163150
def get_wyu_news(self, page):
        
        if page <= 0:
            return []
        res = WyuNews.__wyu_news(page)
        soup = BeautifulSoup(res, from_encoding='utf-8')
        tag_a = soup.find_all(self.__get_tag_a)
        tag_td = soup.find_all(self.__get_tag_td)
        result = []

        for index, item in enumerate(tag_a):
            result.append({
                'url': ''.join(('http://www.wyu.cn/news/', item.attrs['href']))
                , 'title': item.string
                , 'type': self.__get_news_type(tag_td[index])
                , 'from': self.__get_news_from(tag_td[index])
                , 'posttime': self.__get_news_posttime(tag_td[index])
            })
        return result
443351
def _get_feed_data(self, file_paths):
        
        rv = {}
        for i in file_paths:
            # TODO(crow): only support first category
            _ = i.split('/')
            category = _[-2]
            name = _[-1].split('.')[0]
            page_config, md = self._get_config_and_content(i)
            parsed_md = tools.parse_markdown(md, self.site_config)
            rv.setdefault(category, {})
            rv[category].update(
                {
                    i: {
                        'title': page_config.get('title', ''),
                        'name': name.decode('utf-8'),
                        'content': parsed_md,
                        'date': page_config.get('date', '')
                        }
                    }
                )
        return rv
1192764
public function getFeed(HTTPRequest $request)
    {
        $link = $this->Link('rss');
        $class = $this->decodeClassName($request->param('ID'));
        $id = $request->param('OtherID');

        // Support old pageid param
        if (!$id && !$class && ($id = $request->getVar('pageid'))) {
            $class = SiteTree::class;
        }

        $comments = Comment::get()->filter([
            'Moderated' => 1,
            'IsSpam' => 0,
        ]);

        // Check if class filter
        if ($class) {
            if (!is_subclass_of($class, DataObject::class) || !$class::has_extension(CommentsExtension::class)) {
                return $this->httpError(404);
            }
            $this->setParentClass($class);
            $comments = $comments->filter('ParentClass', $class);
            $link = Controller::join_links($link, $this->encodeClassName($class));

            // Check if id filter
            if ($id) {
                $comments = $comments->filter('ParentID', $id);
                $link = Controller::join_links($link, $id);
                $this->setOwnerRecord(DataObject::get_by_id($class, $id));
            }
        }

        $title = _t(__CLASS__ . '.RSSTITLE', "Comments RSS Feed");
        $comments = PaginatedList::create($comments, $request);
        $comments->setPageLength($this->getOption('comments_per_page'));

        return RSSFeed::create(
            $comments,
            $link,
            $title,
            $link,
            'Title',
            'EscapedComment',
            'AuthorName'
        );
    }
686656
def index(request, page):
    """"""
    days = []
    days_found = set()
    query = Entry.query.order_by(Entry.pub_date.desc())
    pagination = Pagination(query, PER_PAGE, page, "index")
    for entry in pagination.entries:
        day = date(*entry.pub_date.timetuple()[:3])
        if day not in days_found:
            days_found.add(day)
            days.append({"date": day, "entries": []})
        days[-1]["entries"].append(entry)
    return render_template("index.html", days=days, pagination=pagination)
504615
def process_response(self, request, response, spider):
        """"""
        return response.replace(body=str(BeautifulSoup(response.body, self.parser)))
285903
private ChangeSet extractChanges(Timestamp readTime) {
    ChangeSet changeSet = new ChangeSet();

    for (Entry<ResourcePath, Document> change : changeMap.entrySet()) {
      if (change.getValue() == null) {
        if (documentSet.contains(change.getKey())) {
          changeSet.deletes.add(documentSet.getDocument(change.getKey()));
        }
        continue;
      }

      QueryDocumentSnapshot snapshot =
          QueryDocumentSnapshot.fromDocument(firestore, readTime, change.getValue());

      if (documentSet.contains(change.getKey())) {
        changeSet.updates.add(snapshot);
      } else {
        changeSet.adds.add(snapshot);
      }
    }

    return changeSet;
  }
643187
def parse_changelog(args: Any) -> Tuple[str, str]:
    """"""
    with open("CHANGELOG.rst", "r") as file:
        match = re.match(
            pattern=r"(.*?Unreleased\n---+\n)(.+?)(\n*[^\n]+\n---+\n.*)",
            string=file.read(),
            flags=re.DOTALL,
        )
    assert match
    header, changes, tail = match.groups()
    tag = "%s - %s" % (args.tag, datetime.date.today().isoformat())

    tagged = "\n%s\n%s\n%s" % (tag, "-" * len(tag), changes)
    if args.verbose:
        print(tagged)

    return "".join((header, tagged, tail)), changes
223910
def get_feeds_url(blog_page, root_page):
    
    if root_page == blog_page:
        return reverse('blog_page_feed')
    else:
        blog_path = strip_prefix_and_ending_slash(blog_page.specific.last_url_part)
        return reverse('blog_page_feed_slug', kwargs={'blog_path': blog_path})
989585
async def GetChanges(self, yaml):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Bundle',
                   request='GetChanges',
                   version=1,
                   params=_params)
        _params['yaml'] = yaml
        reply = await self.rpc(msg)
        return reply
78114
def get_different_page(self, request, page):
        

        if page:
            qs = request.GET.copy()
            qs['page'] = page
            return "%s?%s" % (request.path_info, qs.urlencode())
        return None
409972
private String parseRssFeed(String feed) {
        String[] result = feed.split("<br />");
        String[] result2 = result[2].split("<BR />");

        return result2[0];
    }
157697
def get_next_page(self):
        """"""

        master_node = self._retrieve_next_page()

        seq = []
        for node in master_node.getElementsByTagName("track"):
            track = Track(
                _extract(node, "artist"),
                _extract(node, "name"),
                self.network,
                info={"image": _extract_all(node, "image")},
            )
            track.listener_count = _number(_extract(node, "listeners"))
            seq.append(track)

        return seq
432591
def get_page_tpl_ctx(page, request):
    
    text = Template(page.text).render(Context())
    meta = MetaSeo(page)
    comments = get_object_comments(PageComment, page.id)
    comments_form = PageCommentForm(initial=get_comment_init(request, page))
    if page.slug == Page.MAIN_SLUG:
        crumbs = None
    else:
        crumbs = page.get_breadcrumbs()
    return {'page': page, 'comments': comments, 'comments_form': comments_form, 'text': text, 'meta': meta, 'crumbs': crumbs}
626668
def extract_feed(
    inpath: str, outpath: str, view: View, config: nx.DiGraph = None
) -> str:
    """"""
    config = default_config() if config is None else config
    config = remove_node_attributes(config, "converters")
    feed = load_feed(inpath, view, config)
    return write_feed_dangerously(feed, outpath)
1330228
def current_changed(self, index):
        """"""
#        count = self.get_stack_count()
#        for btn in (self.filelist_btn, self.previous_btn, self.next_btn):
#            btn.setEnabled(count > 1)

        editor = self.get_current_editor()
        if editor.lsp_ready and not editor.document_opened:
            editor.document_did_open()
        if index != -1:
            editor.setFocus()
            logger.debug("Set focus to: %s" % editor.filename)
        else:
            self.reset_statusbar.emit()
        self.opened_files_list_changed.emit()

        self.stack_history.refresh()
        self.stack_history.remove_and_append(index)

        # Needed to avoid an error generated after moving/renaming
        # files outside Spyder while in debug mode.
        # See issue 8749.
        try:
            logger.debug("Current changed: %d - %s" %
                         (index, self.data[index].editor.filename))
        except IndexError:
            pass

        self.update_plugin_title.emit()
        if editor is not None:
            # Needed in order to handle the close of files open in a directory
            # that has been renamed. See issue 5157
            try:
                self.current_file_changed.emit(self.data[index].filename,
                                               editor.get_position('cursor'))
            except IndexError:
                pass