tvdb

package module
v0.0.0-...-8fb50fb Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2015 License: MIT Imports: 7 Imported by: 0

README

tvdb.go

tvdb.go is a client API wrapper for thetvdb.com

Installation

Just run go get github.com/cpjolicoeur/tvdb

Examples
package main

import "github.com/cpjolicoeur/tvdb"

func main() {
    // matches is an array of tvdb.Series entries that match
    // the series you were searching for
    matches, err := tvdb.GetSeries("A-Team")

    // To populate the episode and other information for a specific
    // series, you run the `GetEpisodes()` function
    err = matches[0].GetEpisodes()

    // You can also create a Series entry directly if you already
    // know it's TVDB id through other means
    series := &tvdb.Series{Id: '123456'}
    err = series.GetEpisodes()
}

Documentation

Index

Constants

View Source
const (
	BASE_URL     = `http://thetvdb.com/api`
	TVDB_API_KEY = `5127BBF385F9FA53`
	LANGUAGE     = `en`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Episode

type Episode struct {
	Id       string  `xml:"id"`
	Name     string  `xml:"EpisodeName"`
	Number   float32 `xml:"EpisodeNumber"`
	Season   float32 `xml:"SeasonNumber"`
	AirDate  string  `xml:"FirstAired"`
	Overview string  `xml:"Overview"`
	SeasonId int32   `xml:"seasonid"`
	SeriesId int32   `xml:"seriesid"`
}

Represents a TVDB Episode

type Series

type Series struct {
	Name     string    `xml:"SeriesName"`
	Id       string    `xml:"seriesid"`
	Episodes []Episode `xml:"Episode"`
}

Represents a TVDB Series

func GetSeries

func GetSeries(name string) ([]Series, error)

GetSeries returns an array of Series entries that match the given name parameter

func (*Series) GetEpisodes

func (s *Series) GetEpisodes() error

GetEpisodes populates the Series with episode information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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