scrape v3.1.0 Scrape.IR.Feed

Information Retrieval implementations to extract data from feeds (RSS or Atom).

Makes intense use of Scrape.Tools.Tree and it's functions to operate on nested maps instead of raw XML documents.

Link to this section Summary

Functions

Extract the (best) description from the feed.

Returns the list of all feed items.

Extract the (best) title from the feed.

Extract the website_url from the feed.

Link to this section Functions

Link to this function

description(feed)
description(String.t() | map()) :: nil | String.t() | map()

Extract the (best) description from the feed.

Example

iex> Feed.description("<feed><description>abc</description></feed>")
"abc"
Link to this function

items(feed)
items(String.t() | map()) :: nil | [map()]

Returns the list of all feed items.

Example

iex> Feed.items("<feed><entry><title>abc</title></entry></feed>")
[%{"title" => "abc"}]
Link to this function

title(feed)
title(String.t() | map()) :: nil | String.t() | map()

Extract the (best) title from the feed.

Example

iex> Feed.title("<feed><title>abc</title></feed>")
"abc"
Link to this function

website_url(feed)
website_url(String.t() | map()) :: nil | String.t() | map()

Extract the website_url from the feed.

Example

iex> Feed.website_url("<feed><link href='http://example.com' /></feed>")
"http://example.com"