[metrics-bugs] #23854 [Metrics/Website]: Add an RSS feed for https://metrics.torproject.org/news.html
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Mar 19 08:09:51 UTC 2018
#23854: Add an RSS feed for https://metrics.torproject.org/news.html
-----------------------------+--------------------------
Reporter: cypherpunks | Owner: irl
Type: enhancement | Status: accepted
Priority: Medium | Milestone:
Component: Metrics/Website | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-----------------------------+--------------------------
Comment (by karsten):
Replying to [comment:4 irl]:
> Done a little hacking on this, I think my plan looks like:
>
> * Add a formatAsFeedItem method to `org.torproject.metrics.web.News`
> * Point the resource `/feed.xml` at `NewsServlet`
> * Add a JSP named `feed.jsp`, which is used instead of `news.jsp` to
render the feed version
> * Implement only ATOM (RFC4287), not RSS, as ATOM has far better support
for internationalisation that may be used later, where internationalising
RSS may hold back that work
Sounds good!
> This would be the way to do it to match the way the news page is
currently built. I do wonder though if perhaps we should instead refactor
the way the news page works:
>
> * Remove the formatAsTableRow method from
`org.torproject.metrics.web.News`
> * Make getters for `org.torproject.metrics.news.News` public
> * Re-implement formatAsTableRow using JSTL in `news.jsp`
> * Point the resource `/feed.xml` at `NewsServlet`
> * Add a `feed.jsp` using JSTL
Hmm, I'm not sure how complex that JSTL variant of `formatAsTableRow`
would become. Also keep in mind that we're using formatted news items in
`NewsServlet` ''and'' `GraphServlet`.
> We definitely do not need to add ROME, or a similar library, at least
for now. As an example to get an idea, the RSS 0.91 hacky JSP (where I
made getDescription public so that it could be available):
>
> {{{
> <%@ page contentType="text/xml" %><?xml version="1.0"?>
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
> <rss version="0.91">
> <channel>
> <title>Tor Metrics - News</title>
> <link>https://metrics.torproject.org/</link>
> <c:forEach var="entry" items="${news}">
> <item>
> <title>
> <c:out value="${entry.description}"/>
> </title>
> </item>
> </c:forEach>
> </channel>
> }}}
Great that we don't need to add a library.
> karsten, iwakeh - Which approach do you think would be best?
I'd say let's start with the first plan. Thanks for researching these
alternatives!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23854#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the metrics-bugs
mailing list