scrape v3.1.0 Scrape.IR.FeedItem

Similar (and used by) Scrape.IR.Feed, but has specialized selectors to extract data from feed items/entries.

Link to this section Summary

Functions

Extract the article_url from the feed item.

Extract the author from the feed item.

Extract the (best) description from the feed item.

Extract the image_url from the feed item.

Extract the possible tags from the feed item.

Extract the (best) title from the feed item.

Link to this section Functions

Link to this function

article_url(tree, url \\ "")
article_url(String.t() | map(), nil | String.t()) :: nil | String.t()

Extract the article_url from the feed item.

Example

iex> FeedItem.article_url("<link href='http://example.com' />")
"http://example.com"

iex> FeedItem.article_url("<link href='/url' />", "http://example.com")
"http://example.com/url"
Link to this function

author(tree)
author(String.t() | map()) :: nil | String.t()

Extract the author from the feed item.

Example

iex> FeedItem.author("<author>abc</author>")
"abc"
Link to this function

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

Extract the (best) description from the feed item.

Example

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

image_url(tree, url \\ "")
image_url(String.t() | map(), nil | String.t()) :: nil | String.t()

Extract the image_url from the feed item.

Example

iex> FeedItem.image_url("<enclosure url='abc' />")
"abc"
Link to this function

tags(tree)
tags(String.t() | map()) :: [String.t()]

Extract the possible tags from the feed item.

Example

iex> FeedItem.tags("<category>abc</category>")
["abc"]

iex> FeedItem.tags("<feed></feed>")
[]
Link to this function

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

Extract the (best) title from the feed item.

Example

iex> FeedItem.title("<title>abc</title>")
"abc"