Documentation ¶
Index ¶
- Constants
- func AnimeSortByLastUpdated(list []*Anime) sort.Interface
- func AnimeSortByScore(list []*Anime) sort.Interface
- func AnimeSortByTitle(list []*Anime) sort.Interface
- func AnimeSortByWatchedEpisodes(list []*Anime) sort.Interface
- func UpdateEntryWithAnimation(c *Client, entry *Anime) error
- func VerifyCredentials(credentials string) bool
- type Anime
- type AnimeCustomSort
- type AnimeDetails
- type AnimeList
- type AnimeScore
- type AnimeStatus
- type AnimeType
- type Character
- type Client
- type MyStatus
- type Related
- type Staff
Constants ¶
View Source
const ( BaseMALAddress = "https://myanimelist.net" ApiEndpoint = BaseMALAddress + "/api" VerifyCredentialsEndpoint = ApiEndpoint + "/account/verify_credentials.xml" )
View Source
const ( UpdateEndpoint = ApiEndpoint + "/animelist/update/%d.xml" //%d - anime database ID DeleteEndpoint = ApiEndpoint + "/animelist/delete/%d.xml" //%d - anime database ID UserAnimeListEndpoint = BaseMALAddress + "/malappinfo.php?u=%s&status=%s&type=anime" //%s - username %s - status AnimePage = BaseMALAddress + "/anime/%d" //%d - anime database ID )
For using as a printf format
View Source
const AnimeXMLTemplate = `` /* 389-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AnimeSortByLastUpdated ¶
func AnimeSortByScore ¶
func AnimeSortByTitle ¶
func VerifyCredentials ¶
Types ¶
type Anime ¶
type Anime struct { ID int `xml:"series_animedb_id"` Title string `xml:"series_title"` Synonyms string `xml:"series_synonyms"` Type AnimeType `xml:"series_type"` Episodes int `xml:"series_episodes"` Status AnimeStatus `xml:"series_status"` SeriesStart string `xml:"series_start"` SeriesEnd string `xml:"series_end"` ImageURL string `xml:"series_image"` MyID int `xml:"my_id"` WatchedEpisodes int `xml:"my_watched_episodes"` MyStart string `xml:"my_start_date"` MyFinish string `xml:"my_finish_date"` MyScore AnimeScore `xml:"my_score"` MyStatus MyStatus `xml:"my_status"` MyRewatching int `xml:"my_rewatching"` MyRewatchingEpisode int `xml:"my_rewatching_ep"` LastUpdated int64 `xml:"my_last_updated"` MyTags string `xml:"my_tags"` }
type AnimeCustomSort ¶
func (AnimeCustomSort) Len ¶
func (acs AnimeCustomSort) Len() int
func (AnimeCustomSort) Less ¶
func (acs AnimeCustomSort) Less(i, j int) bool
func (AnimeCustomSort) Swap ¶
func (acs AnimeCustomSort) Swap(i, j int)
type AnimeDetails ¶
type AnimeDetails struct { JapaneseTitle string Related []Related Synopsis string Background string Characters []Character Staff []Staff OpeningThemes []string EndingThemes []string Premiered string Broadcast string Producers []string Licensors []string Studios []string Source string Genres []string Duration string Rating string Score float64 ScoreVoters int Ranked int Popularity int Members int Favorites int }
func FetchDetailsWithAnimation ¶
func FetchDetailsWithAnimation(c *Client, entry *Anime) (*AnimeDetails, error)
type AnimeList ¶
type AnimeList []*Anime
func (AnimeList) DeleteByID ¶
func (AnimeList) FilterByStatus ¶
type AnimeScore ¶
type AnimeScore int
const ( NotRatedYet AnimeScore = iota Appalling Horrible VeryBad Bad Average Fine Good VeryGood Great Masterpiece )
func ParseScore ¶
func ParseScore(score int) (AnimeScore, error)
type AnimeStatus ¶
type AnimeStatus int
const ( CurrentlyAiring AnimeStatus = iota + 1 FinishedAiring NotYetAired )
func (AnimeStatus) String ¶
func (status AnimeStatus) String() string
type Client ¶
type Client struct { Username string ID string `xml:"user_id"` Watching int `xml:"user_watching"` Completed int `xml:"user_completed"` OnHold int `xml:"user_onhold"` Dropped int `xml:"user_dropped"` PlanToWatch int `xml:"user_plantowatch"` DaysSpentWatching float64 `xml:"user_days_spent_watching"` // contains filtered or unexported fields }
func (*Client) AnimeList ¶
Note: Since anime list endpoint, besides anime list, returns account stats, this method also updates Client with them
func (*Client) FetchDetails ¶
func (c *Client) FetchDetails(entry *Anime) (*AnimeDetails, error)
This works by scraping the normal MAL website for given entry. It means that this method will stop working when they change something
Click to show internal directories.
Click to hide internal directories.