Modules@robinpath/rss
rss

@robinpath/rss

0.1.4Node.jsPublic

Parse RSS and Atom feeds, detect new entries

RSS

Parse RSS and Atom feeds, detect new entries, and get feed metadata

Package: @robinpath/rss | Category: Web | Type: Utility

Authentication

No authentication required. All functions are available immediately.

Use Cases

Use the rss module when you need to:

  • Parse an RSS/Atom feed from a URL -- Use rss.parse to perform this operation
  • Parse RSS/Atom XML from a string -- Use rss.parseString to perform this operation
  • Get feed items with a limit -- Use rss.getItems to perform this operation
  • Get only new items since last check or since a date -- Use rss.getNew to perform this operation
  • Get the most recent item from a feed -- Use rss.getLatest to perform this operation

Quick Reference

FunctionDescriptionReturns
parseParse an RSS/Atom feed from a URL{title, description, link, items}
parseStringParse RSS/Atom XML from a string{title, items}
getItemsGet feed items with a limitArray of items
getNewGet only new items since last check or since a dateArray of new items
getLatestGet the most recent item from a feedLatest item or null
feedInfoGet feed metadata without items{title, description, link, itemCount}

Functions

parse

Parse an RSS/Atom feed from a URL

Module: rss | Returns: object -- {title, description, link, items}

rss.parse "https://blog.example.com/feed"
ParameterTypeRequiredDescription
urlstringYesFeed URL

parseString

Parse RSS/Atom XML from a string

Module: rss | Returns: object -- {title, items}

rss.parseString $xmlContent
ParameterTypeRequiredDescription
xmlstringYesXML content

getItems

Get feed items with a limit

Module: rss | Returns: array -- Array of items

rss.getItems "https://blog.example.com/feed" 5
ParameterTypeRequiredDescription
urlstringYesFeed URL
limitnumberNoMax items (default 10)

getNew

Get only new items since last check or since a date

Module: rss | Returns: array -- Array of new items

rss.getNew "https://blog.example.com/feed" "2025-01-01"
ParameterTypeRequiredDescription
urlstringYesFeed URL
sincestringNoISO date (optional, uses cache if omitted)

getLatest

Get the most recent item from a feed

Module: rss | Returns: object -- Latest item or null

rss.getLatest "https://blog.example.com/feed"
ParameterTypeRequiredDescription
urlstringYesFeed URL

feedInfo

Get feed metadata without items

Module: rss | Returns: object -- {title, description, link, itemCount}

rss.feedInfo "https://blog.example.com/feed"
ParameterTypeRequiredDescription
urlstringYesFeed URL

Error Handling

All functions throw on failure. Common errors:

ErrorCause
(standard errors)Check function parameters and authentication
@desc "Parse and validate result"
do
  set $result as rss.parse "https://blog.example.com/feed"
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate Items

Retrieve all items and loop through them.

@desc "Get items and iterate results"
do
  set $result as rss.getItems "https://blog.example.com/feed" 5
  each $item in $result
    print $item
  end
enddo

2. Multi-step RSS workflow

Chain multiple rss operations together.

@desc "Parse, parse string, and more"
do
  set $r_parse as rss.parse "https://blog.example.com/feed"
  set $r_parseString as rss.parseString $xmlContent
  set $r_getItems as rss.getItems "https://blog.example.com/feed" 5
  print "All operations complete"
enddo

3. Safe parse with validation

Check results before proceeding.

@desc "Parse and validate result"
do
  set $result as rss.parse "https://blog.example.com/feed"
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • json -- JSON module for complementary functionality

Versions (1)

VersionTagPublished
0.1.4latest1 months ago
Install
$ robinpath add @robinpath/rss

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.4
LicenseMIT
Unpacked Size5.3 KB
Versions1
Weekly Downloads21
Total Downloads21
Stars0
Last Publish1 months ago
Created1 months ago

Keywords

Category

web