RobertMyles / tidyRSS

An R package for extracting 'tidy' data frames from RSS, Atom and JSON feeds
https://robertmyles.github.io/tidyRSS/
Other
82 stars 20 forks source link

tidyfeed throws error when reading feed #30

Closed lodderig closed 4 years ago

lodderig commented 4 years ago

When I try to reed the RSS feed below with tidyfeed it throws an error

`rss <- tidyfeed("https://emm.newsbrief.eu/rss/rss?type=rtn&language=en&duplicates=false")

Error in xpath_search(x$node, x$doc, xpath = xpath, nsMap = ns, num_results = 1) : xmlXPathEval: evaluation failed `

httr::GET and xml2::read_xml both work fine

where is the function rss_parse defined?

RobertMyles commented 4 years ago

Hi @lodderig

Please use the dev version. It will be on CRAN as soon as I clean up a few loose ends. Works fine:

> tidyfeed("https://emm.newsbrief.eu/rss/rss?type=rtn&language=en&duplicates=false")
# A tibble: 441 x 8
   feed_title   feed_link    feed_description      item_title        item_date_published item_description            item_link           item_categories
   <chr>        <chr>        <chr>                 <chr>             <dttm>              <chr>                       <chr>               <list>         
 1 Latest news… https://emm… RSS feed from the co… Uber loses licen… 2019-11-25 10:47:00 LONDON (AP) - London's tra… https://www.action… <chr [1]>      
 2 Latest news… https://emm… RSS feed from the co… France's LVMH se… 2019-11-25 08:55:00 PARIS (AP) - French luxury… https://www.wsoctv… <chr [0]>      
 3 Latest news… https://emm… RSS feed from the co… The licence has … 2019-11-25 11:12:00 "Uber's licence to operate… https://www.somers… <chr [1]>      
 4 Latest news… https://emm… RSS feed from the co… Second UK cinema… 2019-11-25 08:53:00 "A second cinema chain has… https://www.breaki… <chr [0]>      
 5 Latest news… https://emm… RSS feed from the co… New Zealand cric… 2019-11-25 09:38:00 New Zealand Cricket is to … https://www.cheste… <chr [0]>      
 6 Latest news… https://emm… RSS feed from the co… Priceless items … 2019-11-25 10:36:00 This Tuesday April 4, 2019… https://www.timesc… <chr [0]>      
 7 Latest news… https://emm… RSS feed from the co… Donald Trump nom… 2019-11-25 10:30:00 President Donald Trump has… https://www.pressa… <chr [3]>      
 8 Latest news… https://emm… RSS feed from the co… Landslide win fo… 2019-11-25 09:42:00 Hong Kong’s pro-democracy … https://www.yourlo… <chr [0]>      
 9 Latest news… https://emm… RSS feed from the co… Lorry driver ple… 2019-11-25 11:03:00 A lorry driver accused ove… https://www.thegua… <chr [5]>      
10 Latest news… https://emm… RSS feed from the co… 'We Have Require… 2019-11-25 08:05:00 Mumbai: Leaders of the Shi… https://www.news18… <chr [0]>      
# … with 431 more rows

It's actually geo_parse() used, and defined here.

lodderig commented 4 years ago

Thanks a lot for the swift follow-up, works again like a charm.

RobertMyles commented 4 years ago

You're welcome. Thanks for using the package, and in particular for taking the time to file the issue.