Retrieve Full News Story from a Refinitiv RDP (JSON) Connection
rd_get_news_story.Rd
This function retrieves a full news story identified by its story ID via a Refinitiv JSON connection. In the RDP response the story text may be found in different places:
Usage
rd_get_news_story(
RDObject = RefinitivJsonConnect(),
story_id = NULL,
raw_output = FALSE,
debug = FALSE,
renderHTML = FALSE
)
Arguments
- RDObject
A connection object returned by
RefinitivJsonConnect()
. Defaults toRefinitivJsonConnect()
if not supplied.- story_id
Vector of story IDs.
- raw_output
If
TRUE
, returns the raw list of responses.- debug
If
TRUE
, prints debugging messages.- renderHTML
If
TRUE
, the function will open the combined HTML in a browser viewer, and also return the HTML string.
Value
If raw_output = FALSE
(the default), a character vector of the story HTML
(or a single combined HTML string if renderHTML = TRUE
). Otherwise, the raw list
of responses.
Details
- If the response comes from the legacy UDF service, the story is expected in the
story$storyHtml
element.
- If the response comes from the RDP service, the content will be located under
newsItem$contentSet
. In that case, the function first checks for HTML content
in newsItem$contentSet$inlineXML
(if available) and, if not, in
newsItem$contentSet$inlineData
.
If renderHTML
is TRUE, any plain URLs in the resulting HTML will be converted
to clickable links via a helper function make_links_clickable()
(which you should
define elsewhere in your package), and the combined HTML is opened in the viewer.