[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [curn-users] enhancement requests



On 10/08/06 16:34, Mark Fletcher wrote:
> Hi Brian,
>
> I'd like to request another enhancement for your next version. In the
> same way you can override a channel title with TitleOverride, I'd like
> it if I could override that channel's default URL with a parameter like
> "URLOverride". I'm dealing with RSS feeds from Jira and its
> channel.links all point to the main Jira page, rather than to the
> actual report that they're based on.
>
> For that matter, I could use an "EditChannelURL" param instead of or in
> addition to "URLOverride". Jira's channel urls differ from their styled
> html view in only a few parameters. It would probably be easy to derive
> the channel url by applying a regExp to the feed url. Then again,
> looking at your FreeMarker data model, I don't see the feed url exposed
> anywhere. So...

Mark,

Take a look at the EditItemURL and EditFeedURL configuration parameters
in the User's Guide:

http://www.clapper.org/software/java/curn/docs/users-guide/#Feed_EditFeedURL

I use those parameters to change the URLs served up by various places. For
instance, consider this entry from my configuration file:

----------
[Feed_yahoo_top]
# Yahoo News item URLs are of this form:
#
#
http://us.rd.yahoo.com/dailynews/rss/topstories/*http://story.news.yahoo.com/news?tmpl=story2
...
#
# The following edit command strips off the first URL, leaving only the story
# URL. The edit command corresponds to this Perl 5 construct:
#
#        s|^http://.*\*http://|http://\|
#
URL:            ${curn:feedCacheURLPrefix}/yahoo_top_stories.xml
ForceEncoding:  ${curn:feedCacheEncoding}
EditItemURL:    's|^http://.*\*http://|http://|'
#
# All Yahoo News RSS channels seem to use the same generic title. Substitute
# a more useful one.
#
TitleOverride:          Yahoo! News Top Stories
----------

Notice the EditItemURL parameter.

Will that do what you want?

> That brings up one more request :-) If it's not already exposed, can
> you provide FreeMarker access to a channel's rss feed url? In addition
> to enabling regExp manipulation to derive a channel url, it would allow
> me to add an "XML" button to each channel so that my readers could add
> a feed to their own RSS readers.

It's there, but not documented. (That's not on purpose; I just neglected to
document it.) There's a "url" element within each channel element:

   +-- channel ...................... table of contents entry for one channel
         |
         +-- title .................. [String] channel title
         |
         +-- totalItems ............. [int] total items in channel
         |
         +-- channelAnchor .......... [String] HTML anchor name for channel
         |
         +-- url .................... [String] Feed/channel URL

There's a "url" element available for each item, too.

If you look in my "HTML.ftl" FreeMarker template (it's in both the binary
jar and the source tree), you'll see that I use both ${channel.url} and
${item.url}.

I've made a note to update the Freemarker-related docs.
-- 
-Brian

Brian Clapper, http://www.clapper.org/bmc/
Nobody can be as agreeable as an uninvited guest.
---
*** Posted to the curn-users mailing list (curn-users@xxxxxxxxxxx).



 Back to curn-users archive.