itunes

package module
v0.0.0-...-be202e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2017 License: MIT Imports: 10 Imported by: 1

README

itunes

GoDoc Build Status Go Report Card

Have you ever wanted to get the underlying RSS feed from a podcast's iTunes page? Have you ever needed to do it in Go? Well this is the package for you.

Installation

go get github.com/deepilla/itunes

Usage

Import the itunes package.

import "github.com/deepilla/itunes"

Call the ToRSS function.

url, err := itunes.ToRSS("https://itunes.apple.com/us/podcast/s-town/id1212558767?mt=2")
if err != nil {
    log.Fatal(err)
}

fmt.Println("RSS feed is", url) // outputs "RSS feed is http://feeds.stownpodcast.org/stownpodcast"

Note: This package will not work on iTunesU pages as they don't have publicly available feeds.

Licensing

itunes is provided under an MIT License. See the LICENSE file for details.

Documentation

Overview

Package itunes extracts the underlying RSS feed from an iTunes page.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoFeed = errors.New("no feed found")

ErrNoFeed is returned by the ToRSS functions when they fail to find an RSS feed in the given iTunes page. This usually indicates an unsupported page type, such as a non-podcast iTunes page or an iTunesU page.

Functions

func ToRSS

func ToRSS(url string) (string, error)

ToRSS returns the underlying RSS feed from an iTunes URL using the default HTTP client.

func ToRSSClient

func ToRSSClient(url string, client Client) (string, error)

ToRSSClient returns the underlying RSS feed from an iTunes URL using the provided Client.

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

A Client is responsible for executing HTTP requests. Its interface is satisfied by http.Client. Provide your own implementation to intercept requests and responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL