news_to_rss: Convert NEWS File to RSS Feed

View source: R/news_to_rss.R

NEWSRSS-packageR Documentation

Convert NEWS File to RSS Feed

Description

Convert package NEWS file to RSS items.

Usage

news_to_rss(package, file = NULL,
            guid = function(version, date, ...)
                            paste0(package, "_", version, "_", date),
            link,
            guid.digest = FALSE,
            guid.isPermaLink = FALSE,
            ...)

rss_feed(items, title, description, language,
         link, atom.href, copyright)

Arguments

package

character

file

character

guid

a function: the first two arguments are the version and date as specified in the NEWS file

link

character. For rss_feed, the URL of the feed. For news_to_rss, item-specific links.

items

character. The items of the feed, in XML markup.

title

character

description

character

language

character

copyright

character

atom.href

character. See http://www.rssboard.org/rss-profile#namespace-elements-atom-link

guid.digest

logical: use digest package to compute guid?

guid.isPermaLink

logical

...

more arguments

Details

Converts the NEWS file of an R package and converts the NEWS entries into an RSS feed (i.e. XML format).

Value

character vector

Author(s)

Enrico Schumann

See Also

news

Examples



out.file <- tempfile()
require("NEWSRSS")
copyright <- "Copyright 2015, Enrico Schumann"
title <- "NMOF &#8211; Numerical Methods and Optimization in Finance"
link <- "http://enricoschumann.net/R/packages/NMOF/"

description <- "News about package NMOF"
language <- "en-gb"
atom.href <- "http://enricoschumann.net/R/packages/NMOF/NMOF_news.xml"


cat(rss_feed(news_to_rss("NMOF", link = link), title, description,
             language, link, atom.href, copyright),
    file = out.file)

## pretty print with 'xmllint'
## system("xmllint -o ~/ESdotnet/R/packages/NMOF/NMOF_news.xml --format ~/tmp/NMOF_news.xml")


enricoschumann/NEWSRSS documentation built on Oct. 12, 2022, 4:42 a.m.