Metalove v0.2.2 Metalove.Podcast View Source
This module defines a Metalove.Podcast
struct and the main functions working with it.
Link to this section Summary
Functions
Add a feed url to a podcast if it isn't listed yet
Either returns a already scraped podcast for this feed url, or fetches the url and creates a new one if possible
Returns an existing podcast for that id, otherwise nil
Returns an existing podcast for that link if it exists, otherwise nil
Returns the shortened id formed from a website link
Creates a new Metalove.Podcast
struct filled with the information found by scraping the url given. Also triggers a fetch of the given feed to populate the repository
Link to this section Types
t()
View Source
t() :: %Metalove.Podcast{
created_at: DateTime.t(),
feed_urls: [String.t()],
id: String.t(),
main_feed_url: nil | String.t(),
updated_at: DateTime.t()
}
t() :: %Metalove.Podcast{ created_at: DateTime.t(), feed_urls: [String.t()], id: String.t(), main_feed_url: nil | String.t(), updated_at: DateTime.t() }
Represents a podcast.
:id
: String representing the podcast, likely to be a reduced url stripping the schema and the trailing slash, e.g. "atp.fm":main_feed_url
: String representing the mp3 feed if present, otherwise the first one found:feed_urls
: List of URL strings for all the found feeds for this podcast
Link to this section Functions
add_feed_urls(podcast, list)
View Source
add_feed_urls(Metalove.Podcast.t(), [String.t()]) :: Metalove.Podcast.t()
add_feed_urls(Metalove.Podcast.t(), [String.t()]) :: Metalove.Podcast.t()
Add a feed url to a podcast if it isn't listed yet.
get_by_feed_url(feed_url) View Source
Either returns a already scraped podcast for this feed url, or fetches the url and creates a new one if possible
get_by_id(id) View Source
Returns an existing podcast for that id, otherwise nil
get_by_link(link) View Source
Returns an existing podcast for that link if it exists, otherwise nil
id_from_link(url) View Source
Returns the shortened id formed from a website link
new_with_main_feed_url(main_feed_url)
View Source
new_with_main_feed_url(String.t()) :: Metalove.Podcast.t()
new_with_main_feed_url(String.t()) :: Metalove.Podcast.t()
Creates a new Metalove.Podcast
struct filled with the information found by scraping the url given. Also triggers a fetch of the given feed to populate the repository.