Documentation ¶
Overview ¶
Low-level wrapper around the AniDB HTTP API. Only implements the 'anime' and 'categorylist' requests.
This wrapper does not implement caching. The API requires aggressive caching.
Index ¶
- Constants
- type Anime
- type AnimeRating
- type AnimeRatings
- type AnimeTitle
- type CLCategory
- type Category
- type CategoryList
- type Character
- type Characters
- type Creator
- type EpNo
- type Episode
- type EpisodeTitle
- type Episodes
- type ExternalEntity
- type Rating
- type Recommendation
- type RelatedAnime
- type Resource
- type Seiyuu
- type SimilarAnime
- type Tag
Constants ¶
const ( AniDBImageBaseURL = "http://img7.anidb.net/pics/anime/" // Base URL for the various Pictures in the response DateFormat = "2006-01-02" // Use to convert the various YYYY-MM-DD timestamps to a time.Time. // Base URLs for the various resources. // Meant for use with fmt.Sprintf. ANNFormat = "http://www.animenewsnetwork.com/encyclopedia/anime.php?id=%v" // Type 1 MyAnimeListFormat = "http://myanimelist.net/anime/%v" // Type 2 AnimeNfoFormat = "http://www.animenfo.com/animetitle,%v,%v,a.html" // Type 3 WikiEnglishFormat = "http://en.wikipedia.org/wiki/%v" // Type 6 WikiJapaneseFormat = "http://ja.wikipedia.org/wiki/%v" // Type 7 SyoboiFormat = "http://cal.syoboi.jp/tid/%v/time" // Type 8 AllCinemaFormat = "http://www.allcinema.net/prog/show_c.php?num_c=%v" // Type 9 AnisonFormat = "http://anison.info/data/program/%v.html" // Type 10 LainGrJpFormat = "http://lain.gr.jp/%v" // Type 11 VNDBFormat = "http://vndb.org/v%v" // Type 14 MaruMeganeFormat = "http://www.anime.marumegane.com/%v.html" // Type 15 TVAnimationMuseum = "http://home-aki.cool.ne.jp/anime-list/%s.htm" // Type 17 (broken) WikiKoreanformat = "http://ko.wikipedia.org/wiki/%v" // Type 19 WikiChineseFormat = "http://zh.wikipedia.org/wiki/%v" // Type 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anime ¶
type Anime struct { Error string `xml:",chardata"` // API request encountered an error if this is not "" ID int `xml:"id,attr"` // AID of the anime R18 bool `xml:"restricted,attr"` // Whether the anime is considered porn Type string `xml:"type"` // "TV Series", "Movie", "OVA", etc EpisodeCount int `xml:"episodecount"` // Unreliable, has a set value even when the total number is unknown StartDate string `xml:"startdate"` // YYYY-MM-DD EndDate string `xml:"enddate"` // YYYY-MM-DD Titles []AnimeTitle `xml:"titles>title"` RelatedAnime []RelatedAnime `xml:"relatedanime>anime"` SimilarAnime []SimilarAnime `xml:"similaranime>anime"` Recommendations []Recommendation `xml:"recommendations>recommendation"` URL string `xml:"url"` // Official URL Creators []Creator `xml:"creators>name"` Description string `xml:"description"` Ratings AnimeRatings `xml:"ratings"` Picture string `xml:"picture"` // Picture basename; combine with AniDBImageBaseURL for full URL Categories []Category `xml:"categories>category"` // Unsorted Resources []Resource `xml:"resources>resource"` // undocumented Tags []Tag `xml:"tags>tag"` // Unsorted Characters Characters `xml:"characters>character"` // Unsorted Episodes Episodes `xml:"episodes>episode"` // Unsorted }
type AnimeRating ¶
type AnimeRating struct { Count int `xml:"count,attr"` // Amount of votes/reviews Rating float32 `xml:",chardata"` // Average }
Separate from regular Rating because the XML structure is different.
type AnimeRatings ¶
type AnimeRatings struct { Permanent AnimeRating `xml:"permanent"` // Votes from people who watched everything Temporary AnimeRating `xml:"temporary"` // Votes from people who are still watching it Review AnimeRating `xml:"review"` // Votes from reviews }
type AnimeTitle ¶
type AnimeTitle struct { Lang string `xml:"lang,attr"` // Language in ISO-ish format Type string `xml:"type,attr"` // "official", "short", etc Title string `xml:",chardata"` }
Title with language and type identifier.
Title with Lang = ja, Type = official is the official Kanji title.
Title with Lang = x-jat, Type = main is the romanized version, also known in other APIs as the Primary Title.
type CLCategory ¶
type CLCategory struct { ID int `xml:"id,attr"` // Category ID ParentID int `xml:"parentid,attr"` // ID of the parent category R18 bool `xml:"ishentai,attr"` // Whether the category is associated with porn or not Name string `xml:"name"` // Category name Description string `xml:"description"` // Category description }
Separate from regular Category because of different XML structure.
type Category ¶
type Category struct { ID int `xml:"id,attr"` // Category ID ParentID int `xml:"parentid,attr"` // ID of the parent category R18 bool `xml:"hentai,attr"` // Whether the category represents porn works or not Weight int `xml:"weight,attr"` // Weight of the category for this anime Name string `xml:"name"` // Category name Description string `xml:"description"` // Category description }
type CategoryList ¶
type CategoryList struct { Error string `xml:",chardata"` Categories []CLCategory `xml:"category"` }
func GetCategoryList ¶
func GetCategoryList() (cl CategoryList, err error)
type Character ¶
type Character struct { ID int `xml:"id,attr"` // Character ID Type string `xml:"type,attr"` // "main character in", "secondary cast in", "appears in" Updated string `xml:"update,attr"` // YYYY-MM-DD Rating Rating `xml:"rating"` Name string `xml:"name"` // Always romaji Gender string `xml:"gender"` // "male", "female", "unknown", sometimes blank Description string `xml:"description"` CharacterType string `xml:"charactertype"` // "Character", "Organization", "Vessel", etc Episodes string `xml:"episodes"` // List of episodes where character appears Picture string `xml:"picture"` // Picture basename; combine with AniDBImageBaseURL for full URL Seiyuu *Seiyuu `xml:"seiyuu"` // The voice actor, if present }
type Characters ¶
type Characters []Character // Implements sort.Interface; groups by Type and sorts by Name
func (Characters) Len ¶
func (cs Characters) Len() int
func (Characters) Less ¶
func (cs Characters) Less(i, j int) bool
func (Characters) Swap ¶
func (cs Characters) Swap(i, j int)
type Episode ¶
type Episode struct { ID int `xml:"id,attr"` // Episode ID Updated string `xml:"update,attr"` // YYYY-MM-DD EpNo EpNo `xml:"epno"` Length int `xml:"length"` // Length in minutes (rounding method undocumented) AirDate string `xml:"airdate"` // YYYY-MM-DD Rating Rating `xml:"rating"` Titles []EpisodeTitle `xml:"title"` }
type EpisodeTitle ¶
type Episodes ¶
type Episodes []Episode // Implements sort.Interface; groups by EpNo.Type, orders by the integer portion of EpNo.EpNo
type ExternalEntity ¶
type Recommendation ¶
type RelatedAnime ¶
type Resource ¶
type Resource struct { Type int `xml:"type,attr"` ExternalEntity []ExternalEntity `xml:"externalentity"` }
Completely undocumented. Most entries just have one or two numbers as Identifiers.
Empiric documentation:
Type 1 is the ANN id.
Type 2 is the MyAnimeList ID.
Type 3 is the AnimeNfo ID tuple.
Type 4 is the official japanese webpage. URL may contain additional URLs (official PV, etc)
Type 5 is the official english webpage.
Type 6 is the english wikipedia page name.
Type 7 is the japanese wikipedia page name.
Type 8 is the cal.syoboi.jp schedule ID.
Type 9 is the AllCinema ID.
Type 10 is the anison.info ID.
Type 11 is the lain.gr.jp path.
Type 14 is the VNDB ID.
Type 15 is the MaruMegane ID.
Type 17 would be the TV Animation Museum identifier, but the website is no more.
Type 19 is the korean wikipedia page name.
Type 20 is the chinese wikipedia page name.
type SimilarAnime ¶
type SimilarAnime struct { ID int `xml:"id,attr"` // AID of the similar anime Approval int `xml:"approval,attr"` // How many users have approved of this connection Total int `xml:"total,attr"` // Total of votes in this connection Title string `xml:",chardata"` // Primary title of the recommended anime }
type Tag ¶
type Tag struct { ID int `xml:"id,attr"` // Tag ID Approval int `xml:"approval,attr"` // How many users have approved of the tag Spoiler bool `xml:"localspoiler,attr"` // undocumented GlobalSpoiler bool `xml:"globalspoiler,attr"` // undocumented Updated string `xml:"update,attr"` // YYYY-MM-DD Name string `xml:"name"` // Tag name Count int `xml:"count"` // undocumented }