Documentation ¶
Overview ¶
Package malscraper provides methods to parse MyAnimeList web page.
Malscraper will get HTML body response, parse necessary information from the elements, clean them, and convert to golang model (struct) that can be used easily by other project/package. Malscraper is using "github.com/PuerkitoBio/goquery" package for parsing the HTML body.
// Init malscraper. m, err := malscraper.NewDefault() if err != nil { // handle error } // Don't forget to close. defer m.Close() // Parse anime data. anime, err := m.GetAnime(1) if err != nil { // handle error } // Use anime data. fmt.Println(anime.Title)
Caching ¶
Malscraper provides caching system. As default, malscraper is using in-memory but it is recommended to use persistent cache such as redis. That's why malscraper allows you to create your own cacher which implements this interface. Or you can choose from `https://github.com/rl404/mal-plugin/tree/master/cache`.
type Cacher interface { Get(key string, data interface{}) error Set(key string, data interface{}) error Delete(key string) error Close() error }
And use it when initiating malscraper.
m, err := malscraper.New(malscraper.Config{ Cacher: yourCacher, })
Logging ¶
Logging is also interface so you can use your own logging.
type Logger interface { Trace(format string, args ...interface{}) Debug(format string, args ...interface{}) Info(format string, args ...interface{}) Warn(format string, args ...interface{}) Error(format string, args ...interface{}) Fatal(format string, args ...interface{}) }
And use it when initiating malscraper.
m, err := malscraper.New(malscraper.Config{ Logger: yourLogger, })
Params ¶
Some methods require specific value for the parameter. So, it is recommended to fill the parameter with provided constant to prevent unwanted errors.
m, err := malscraper.New(malscraper.Config{ CacheTime: 24 * time.Hour, CleanImageURL: true, CleanVideoURL: true, LogLevel: malscraper.LevelTrace, LogColor: true, }) m.GetRecommendation(malscraper.AnimeType, 1, 6) m.GetSeason(malscraper.Winter, 2019) m.GetTopAnime(malscraper.TopDefault, 2)
Error ¶
Errors returned by methods are guaranteed from malscraper errors package. You should be able to handle the errors easier. The original errors (from the dependency package) can still be viewed through printed log (if you turn on error log level). All methods also return HTTP response code to help you distinguish the error.
Request Limit ¶
All methods are requesting and accessing MyAnimeList web page so use them responsibly and don't spam too much or your ip will get banned or blacklisted. Recommended 1 request per 3 seconds and use caching. Or for more safety, 1 request per 5 seconds.
Index ¶
- Constants
- type Config
- type Malscraper
- func (m *Malscraper) AdvSearchAnime(query model.Query) ([]model.AnimeSearch, int, error)
- func (m *Malscraper) AdvSearchClub(query model.ClubQuery) ([]model.ClubSearch, int, error)
- func (m *Malscraper) AdvSearchManga(query model.Query) ([]model.MangaSearch, int, error)
- func (m *Malscraper) AdvSearchUser(query model.UserQuery) ([]model.UserSearch, int, error)
- func (m *Malscraper) Close() error
- func (m *Malscraper) GetAnime(id int) (*model.Anime, int, error)
- func (m *Malscraper) GetAnimeArticle(id int) ([]model.ArticleItem, int, error)
- func (m *Malscraper) GetAnimeCharacter(id int) ([]model.CharacterItem, int, error)
- func (m *Malscraper) GetAnimeClub(id int) ([]model.ClubItem, int, error)
- func (m *Malscraper) GetAnimeEpisode(id int, page ...int) ([]model.Episode, int, error)
- func (m *Malscraper) GetAnimeGenres() ([]model.ItemCount, int, error)
- func (m *Malscraper) GetAnimeMoreInfo(id int) (string, int, error)
- func (m *Malscraper) GetAnimeNews(id int) ([]model.NewsItem, int, error)
- func (m *Malscraper) GetAnimePicture(id int) ([]string, int, error)
- func (m *Malscraper) GetAnimeRecommendation(id int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetAnimeRecommendations(page ...int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetAnimeReview(id int, page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetAnimeReviews(page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetAnimeStaff(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetAnimeStats(id int) (*model.Stats, int, error)
- func (m *Malscraper) GetAnimeVideo(id int, page ...int) (*model.Video, int, error)
- func (m *Malscraper) GetAnimeWithGenre(id int, page ...int) ([]model.AnimeItem, int, error)
- func (m *Malscraper) GetArticle(id int) (*model.Article, int, error)
- func (m *Malscraper) GetArticleTag() ([]model.ArticleTagItem, int, error)
- func (m *Malscraper) GetArticles(pageTag ...interface{}) ([]model.ArticleItem, int, error)
- func (m *Malscraper) GetBestReviews(page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetCharacter(id int) (*model.Character, int, error)
- func (m *Malscraper) GetCharacterAnime(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetCharacterArticle(id int) ([]model.ArticleItem, int, error)
- func (m *Malscraper) GetCharacterClub(id int) ([]model.ClubItem, int, error)
- func (m *Malscraper) GetCharacterManga(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetCharacterOgraphy(_type int, id int) ([]model.Role, int, error)
- func (m *Malscraper) GetCharacterPicture(id int) ([]string, int, error)
- func (m *Malscraper) GetCharacterVA(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetClub(id int) (*model.Club, int, error)
- func (m *Malscraper) GetClubMember(id int, page ...int) ([]model.ClubMember, int, error)
- func (m *Malscraper) GetClubPicture(id int) ([]string, int, error)
- func (m *Malscraper) GetClubRelated(id int) (*model.ClubRelated, int, error)
- func (m *Malscraper) GetClubs(page ...int) ([]model.ClubSearch, int, error)
- func (m *Malscraper) GetGenres(_type int) ([]model.ItemCount, int, error)
- func (m *Malscraper) GetMagazine(id int, page ...int) ([]model.MangaItem, int, error)
- func (m *Malscraper) GetMagazines() ([]model.ItemCount, int, error)
- func (m *Malscraper) GetManga(id int) (*model.Manga, int, error)
- func (m *Malscraper) GetMangaArticle(id int) ([]model.ArticleItem, int, error)
- func (m *Malscraper) GetMangaCharacter(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetMangaClub(id int) ([]model.ClubItem, int, error)
- func (m *Malscraper) GetMangaGenres() ([]model.ItemCount, int, error)
- func (m *Malscraper) GetMangaMoreInfo(id int) (string, int, error)
- func (m *Malscraper) GetMangaNews(id int) ([]model.NewsItem, int, error)
- func (m *Malscraper) GetMangaPicture(id int) ([]string, int, error)
- func (m *Malscraper) GetMangaRecommendation(id int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetMangaRecommendations(page ...int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetMangaReview(id int, page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetMangaReviews(page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetMangaStats(id int) (*model.Stats, int, error)
- func (m *Malscraper) GetMangaWithGenre(id int, page ...int) ([]model.MangaItem, int, error)
- func (m *Malscraper) GetNews(id int) (*model.News, int, error)
- func (m *Malscraper) GetNewsList(pageTag ...interface{}) ([]model.NewsItem, int, error)
- func (m *Malscraper) GetNewsTag() (*model.NewsTag, int, error)
- func (m *Malscraper) GetPeople(id int) (*model.People, int, error)
- func (m *Malscraper) GetPeopleArticle(id int) ([]model.ArticleItem, int, error)
- func (m *Malscraper) GetPeopleCharacter(id int) ([]model.PeopleCharacter, int, error)
- func (m *Malscraper) GetPeopleManga(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetPeopleNews(id int) ([]model.NewsItem, int, error)
- func (m *Malscraper) GetPeoplePicture(id int) ([]string, int, error)
- func (m *Malscraper) GetPeopleStaff(id int) ([]model.Role, int, error)
- func (m *Malscraper) GetProducer(id int, page ...int) ([]model.AnimeItem, int, error)
- func (m *Malscraper) GetProducers() ([]model.ItemCount, int, error)
- func (m *Malscraper) GetRecommendation(_type int, id1, id2 int) (*model.Recommendation, int, error)
- func (m *Malscraper) GetRecommendationAnime(id1, id2 int) (*model.Recommendation, int, error)
- func (m *Malscraper) GetRecommendationManga(id1, id2 int) (*model.Recommendation, int, error)
- func (m *Malscraper) GetRecommendations(_type int, page ...int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetReview(id int) (*model.Review, int, error)
- func (m *Malscraper) GetReviews(_type int, page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetSeason(seasonYear ...interface{}) ([]model.AnimeItem, int, error)
- func (m *Malscraper) GetTopAnime(typePage ...int) ([]model.TopAnime, int, error)
- func (m *Malscraper) GetTopCharacter(page ...int) ([]model.TopCharacter, int, error)
- func (m *Malscraper) GetTopManga(typePage ...int) ([]model.TopManga, int, error)
- func (m *Malscraper) GetTopPeople(page ...int) ([]model.TopPeople, int, error)
- func (m *Malscraper) GetUser(username string) (*model.User, int, error)
- func (m *Malscraper) GetUserAnime(username string, page ...int) ([]model.UserAnime, int, error)
- func (m *Malscraper) GetUserAnimeAdv(query model.UserListQuery) ([]model.UserAnime, int, error)
- func (m *Malscraper) GetUserClub(username string) ([]model.Item, int, error)
- func (m *Malscraper) GetUserFavorite(username string) (*model.UserFavorite, int, error)
- func (m *Malscraper) GetUserFriend(username string, page ...int) ([]model.UserFriend, int, error)
- func (m *Malscraper) GetUserHistory(username string, _type ...int) ([]model.UserHistory, int, error)
- func (m *Malscraper) GetUserManga(username string, page ...int) ([]model.UserManga, int, error)
- func (m *Malscraper) GetUserMangaAdv(query model.UserListQuery) ([]model.UserManga, int, error)
- func (m *Malscraper) GetUserRecommendation(username string, page ...int) ([]model.Recommendation, int, error)
- func (m *Malscraper) GetUserReview(username string, page ...int) ([]model.Review, int, error)
- func (m *Malscraper) GetUserStats(username string) (*model.UserStats, int, error)
- func (m *Malscraper) SearchAnime(title string, page ...int) ([]model.AnimeSearch, int, error)
- func (m *Malscraper) SearchCharacter(name string, page ...int) ([]model.CharacterSearch, int, error)
- func (m *Malscraper) SearchClub(name string, page ...int) ([]model.ClubSearch, int, error)
- func (m *Malscraper) SearchManga(title string, page ...int) ([]model.MangaSearch, int, error)
- func (m *Malscraper) SearchPeople(name string, page ...int) ([]model.PeopleSearch, int, error)
- func (m *Malscraper) SearchUser(username string, page ...int) ([]model.UserSearch, int, error)
Constants ¶
const ( LevelZero = iota // no log LevelError // error, fatal LevelInfo // info, error, fatal LevelDebug // debug, info, warning, error, fatal LevelTrace // trace, debug, info, warning, error, fatal // Default level. LevelDefault = LevelError )
Log level list. Used for initiating logger.
const ( AllType = iota AnimeType MangaType )
Main types.
const ( Winter = "winter" Spring = "spring" Summer = "summer" Fall = "fall" )
Season list.
const ( TopDefault = iota TopAiring TopUpcoming TopTV TopMovie TopOVA TopONA TopSpecial TopPopularAnime TopFavoriteAnime )
Top anime types.
const ( TopManga = iota + 1 TopNovel TopOneshot TopDoujin TopManhwa TopManhua TopPopularManga TopFavoriteManga )
Top manga types.
const ( TypeDefault = iota TypeTV TypeOVA TypeMovie TypeSpecial TypeONA TypeMusic )
Anime types.
const ( TypeManga = iota + 1 TypeLightNovel TypeOneShot TypeDoujinshi TypeManhwa TypeManhua TypeNovel )
Manga types.
const ( StatusOnGoing = iota + 1 StatusFinished StatusUpcoming StatusHiatus // manga only StatusDiscontinued // manga only )
Anime & manga airing/publishing status.
const ( RatingDefault = iota RatingG // all ages RatingPG // children RatingPG13 // teens 13 or older RatingR17 // 17+ (violence & profanity) RatingR // mild nudity RatingRx // hentai )
Anime ratings.
const ( StatusDefault = iota StatusCurrent StatusCompleted StatusOnHold StatusDropped StatusPlanned StatusAll )
User list status.
const ( OrderDefault = iota OrderAnimeTitle OrderAnimeFinishDate OrderAnimeStartDate OrderAnimeScore OrderAnimeType OrderAnimeRated OrderAnimePriority OrderAnimeProgress OrderAnimeStorage OrderAnimeAirStart OrderAnimeAirEnd )
User anime list order.
const ( OrderMangaTitle = iota + 1 OrderMangaFinishDate OrderMangaStartDate OrderMangaScore OrderMangaPriority OrderMangaChapter OrderMangaVolume OrderMangaType OrderMangaPublishStart OrderMangaPublishEnd )
User manga list order.
const ( AnimeReview = iota MangaReview BestReview )
Review types.
const ( GenderDefault = iota GenderMale GenderFemale GenderNonBinary )
Gender list.
const ( AllCategory = iota AnimeCategory ConventionCategory ActorCategory CharacterCategory CompanyCategory GameCategory JapanCategory CityCategory MusicCategory MangaCategory SchoolCategory OtherCategory )
Club categories.
const ( SortDefault = iota SortName SortComment SortPost SortMember )
Club sorts.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Cache interface with basic get & set functions. // Can use your own cacher interface. Cacher service.Cacher // Cache expired time. Will be used to initiating `Cacher` // using in-memory (bigcache) if `Cacher` is empty. CacheTime time.Duration // Does malscraper need to automatically clean any image and video url. // For more information, please read `ImageURLCleaner()` and `VideoURLCleaner()` // function in `pkg/utils/utils.go`. CleanImageURL bool CleanVideoURL bool // Log interface. Can use your own logger interface. Logger service.Logger // Log Level. Show only error as default. Value should be chosen from constant. // Will be used to intiating `Logger` if `Logger` is empty. LogLevel int // Colorful log. Will be used to intiating `Logger` if `Logger` is empty. LogColor bool }
Config is malscraper configuration.
type Malscraper ¶
type Malscraper struct {
// contains filtered or unexported fields
}
Malscraper is malscraper instance which contains all methods to parse MyAnimeList web page.
func NewDefault ¶
func NewDefault() (*Malscraper, error)
NewDefault to quickly create new malscraper with default config. Will cache for 1 day as default.
func NewNoCache ¶
func NewNoCache() (*Malscraper, error)
NewNoCache to create new malscraper without caching.
func (*Malscraper) AdvSearchAnime ¶
func (m *Malscraper) AdvSearchAnime(query model.Query) ([]model.AnimeSearch, int, error)
AdvSearchAnime to search anime with advanced query.
Available constant options.
Type Status Rating ----------- -------------- ------------- TypeDefault StatusDefault RatingDefault TypeTV StatusOnGoing RatingG TypeOVA StatusFinished RatingPG TypeMovie StatusUpcoming RatingPG13 TypeSpecial RatingR17 TypeONA RatingR TypeMusic RatingRx
ProducerID should be from `GetProducers()`.
GenreID should be from `GetAnimeGenres()`.
func (*Malscraper) AdvSearchClub ¶
func (m *Malscraper) AdvSearchClub(query model.ClubQuery) ([]model.ClubSearch, int, error)
AdvSearchClub to search club with advanced query.
Available constant options.
Category Sort ------------------ ----------- AllCategory SortDefault AnimeCategory SortName ConventionCategory SortComment ActorCategory SortPost CharacterCategory SortMember CompanyCategory GameCategory JapanCategory CityCategory MusicCategory MangaCategory SchoolCategory OtherCategory
Example: https://myanimelist.net/clubs.php?cat=club&catid=0&q=naruto&action=find.
func (*Malscraper) AdvSearchManga ¶
func (m *Malscraper) AdvSearchManga(query model.Query) ([]model.MangaSearch, int, error)
AdvSearchManga to search manga with advanced query.
Available constant options.
Type Status ----------- -------------- TypeDefault StatusDefault TypeManga StatusOnGoing TypeLightNovel StatusFinished TypeOneShot StatusUpcoming TypeDoujinshi StatusHiatus TypeManhwa StatusDiscontinued TypeManhua TypeNovel
MagazineID should be from `GetMagazines()`.
GenreID should be from `GetMangaGenres()`.
func (*Malscraper) AdvSearchUser ¶
func (m *Malscraper) AdvSearchUser(query model.UserQuery) ([]model.UserSearch, int, error)
AdvSearchUser to search user with advanced query.
Gender should be one of these constants.
GenderDefault GenderMale GenderFemale GenderNonBinary
func (*Malscraper) Close ¶
func (m *Malscraper) Close() error
Close to close cache connection if exists.
func (*Malscraper) GetAnime ¶
GetAnime to get anime detail information.
Example: https://myanimelist.net/anime/1.
func (*Malscraper) GetAnimeArticle ¶
func (m *Malscraper) GetAnimeArticle(id int) ([]model.ArticleItem, int, error)
GetAnimeArticle to get anime featured article list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/featured.
func (*Malscraper) GetAnimeCharacter ¶
func (m *Malscraper) GetAnimeCharacter(id int) ([]model.CharacterItem, int, error)
GetAnimeCharacter to get anime character list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/characters.
func (*Malscraper) GetAnimeClub ¶
GetAnimeClub to get anime club list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/clubs.
func (*Malscraper) GetAnimeEpisode ¶
GetAnimeEpisode to get anime episode list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/episode.
func (*Malscraper) GetAnimeGenres ¶
func (m *Malscraper) GetAnimeGenres() ([]model.ItemCount, int, error)
GetAnimeGenres to get anime genre list.
Example: https://myanimelist.net/anime.php.
func (*Malscraper) GetAnimeMoreInfo ¶
func (m *Malscraper) GetAnimeMoreInfo(id int) (string, int, error)
GetAnimeMoreInfo to get anime more info.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/moreinfo.
func (*Malscraper) GetAnimeNews ¶
GetAnimeNews to get anime news list.
func (*Malscraper) GetAnimePicture ¶
func (m *Malscraper) GetAnimePicture(id int) ([]string, int, error)
GetAnimePicture to get anime picture list.
func (*Malscraper) GetAnimeRecommendation ¶
func (m *Malscraper) GetAnimeRecommendation(id int) ([]model.Recommendation, int, error)
GetAnimeRecommendation to get anime recommendation list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/userrecs
func (*Malscraper) GetAnimeRecommendations ¶
func (m *Malscraper) GetAnimeRecommendations(page ...int) ([]model.Recommendation, int, error)
GetAnimeRecommendations to get anime recommendation list.
Example: https://myanimelist.net/recommendations.php?s=recentrecs&t=anime.
func (*Malscraper) GetAnimeReview ¶
GetAnimeReview to get anime review list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/reviews.
func (*Malscraper) GetAnimeReviews ¶
GetAnimeReviews to get anime review list.
func (*Malscraper) GetAnimeStaff ¶
GetAnimeStaff to get anime staff list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/characters.
func (*Malscraper) GetAnimeStats ¶
GetAnimeStats to get anime stats.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/stats.
func (*Malscraper) GetAnimeVideo ¶
GetAnimeVideo to get anime video list.
Example: https://myanimelist.net/anime/1/Cowboy_Bebop/video.
func (*Malscraper) GetAnimeWithGenre ¶
GetAnimeWithGenre to get anime list with specific genre.
func (*Malscraper) GetArticle ¶
GetArticle to get featured article detail information.
Example: https://myanimelist.net/featured/2321/Free_Manga_Service__Update__New_Anime_Titles.
func (*Malscraper) GetArticleTag ¶
func (m *Malscraper) GetArticleTag() ([]model.ArticleTagItem, int, error)
GetArticleTag to get featured article tag list.
Example: https://myanimelist.net/featured/tag.
func (*Malscraper) GetArticles ¶
func (m *Malscraper) GetArticles(pageTag ...interface{}) ([]model.ArticleItem, int, error)
GetArticles to get featured article list.
Tag should be from `GetArticleTag()`.
Example: https://myanimelist.net/featured.
func (*Malscraper) GetBestReviews ¶
GetBestReviews to get best anime & manga review list.
func (*Malscraper) GetCharacter ¶
GetCharacter to get character detail information.
func (*Malscraper) GetCharacterAnime ¶
GetCharacterAnime to get character animeography list.
func (*Malscraper) GetCharacterArticle ¶
func (m *Malscraper) GetCharacterArticle(id int) ([]model.ArticleItem, int, error)
GetCharacterArticle to get character featured article list.
Example: https://myanimelist.net/character/1/Spike_Spiegel/featured.
func (*Malscraper) GetCharacterClub ¶
GetCharacterClub to get character club list.
Example: https://myanimelist.net/character/1/Spike_Spiegel/clubs.
func (*Malscraper) GetCharacterManga ¶
GetCharacterManga to get character mangaography list.
func (*Malscraper) GetCharacterOgraphy ¶
GetCharacterOgraphy to get character animeography/mangaography list.
Param `_type` should be one of these constants.
AnimeType MangaType
Or just use method `GetCharacterAnime()` or `GetCharacterManga()`.
func (*Malscraper) GetCharacterPicture ¶
func (m *Malscraper) GetCharacterPicture(id int) ([]string, int, error)
GetCharacterPicture to get character picture list.
Example: https://myanimelist.net/character/1/Spike_Spiegel/pictures.
func (*Malscraper) GetCharacterVA ¶ added in v1.2.0
GetCharacterVA to get character voice actor list.
func (*Malscraper) GetClub ¶
GetClub to get club detail information.
Example: https://myanimelist.net/clubs.php?cid=1.
func (*Malscraper) GetClubMember ¶
func (m *Malscraper) GetClubMember(id int, page ...int) ([]model.ClubMember, int, error)
GetClubMember to get club member list.
Example: https://myanimelist.net/clubs.php?action=view&t=members&id=1.
func (*Malscraper) GetClubPicture ¶
func (m *Malscraper) GetClubPicture(id int) ([]string, int, error)
GetClubPicture to get club picture list.
Example: https://myanimelist.net/clubs.php?action=view&t=pictures&id=1.
func (*Malscraper) GetClubRelated ¶
func (m *Malscraper) GetClubRelated(id int) (*model.ClubRelated, int, error)
GetClubRelated to get club related list.
Example: https://myanimelist.net/clubs.php?cid=1.
func (*Malscraper) GetClubs ¶
func (m *Malscraper) GetClubs(page ...int) ([]model.ClubSearch, int, error)
GetClubs to get club list.
Example: https://myanimelist.net/clubs.php.
func (*Malscraper) GetGenres ¶
GetGenres to get anime/manga genre list.
Param `_type` should be one of these constants.
AnimeType MangaType
Or just use method `GetAnimeGenres()` or `GetMangaGenres()`.
func (*Malscraper) GetMagazine ¶
GetMagazine to get magazine manga list.
Example: https://myanimelist.net/manga/magazine/1/Big_Comic_Original.
func (*Malscraper) GetMagazines ¶
func (m *Malscraper) GetMagazines() ([]model.ItemCount, int, error)
GetMagazines to get manga magazine/serialization list.
Example: https://myanimelist.net/manga/magazine.
func (*Malscraper) GetManga ¶
GetManga to get manga detail information.
Example: https://myanimelist.net/manga/1.
func (*Malscraper) GetMangaArticle ¶
func (m *Malscraper) GetMangaArticle(id int) ([]model.ArticleItem, int, error)
GetMangaArticle to get manga featured article list.
func (*Malscraper) GetMangaCharacter ¶
GetMangaCharacter to get manga character list.
Example: https://myanimelist.net/manga/1/Monster/characters.
func (*Malscraper) GetMangaClub ¶
GetMangaClub to get manga club list.
func (*Malscraper) GetMangaGenres ¶
func (m *Malscraper) GetMangaGenres() ([]model.ItemCount, int, error)
GetMangaGenres to get manga genre list.
Example: https://myanimelist.net/manga.php.
func (*Malscraper) GetMangaMoreInfo ¶
func (m *Malscraper) GetMangaMoreInfo(id int) (string, int, error)
GetMangaMoreInfo to get manga more info.
func (*Malscraper) GetMangaNews ¶
GetMangaNews to get manga news list.
func (*Malscraper) GetMangaPicture ¶
func (m *Malscraper) GetMangaPicture(id int) ([]string, int, error)
GetMangaPicture to get manga picture list.
func (*Malscraper) GetMangaRecommendation ¶
func (m *Malscraper) GetMangaRecommendation(id int) ([]model.Recommendation, int, error)
GetMangaRecommendation to get manga recommendation list.
func (*Malscraper) GetMangaRecommendations ¶
func (m *Malscraper) GetMangaRecommendations(page ...int) ([]model.Recommendation, int, error)
GetMangaRecommendations to get manga recommendation list.
Example: https://myanimelist.net/recommendations.php?s=recentrecs&t=manga.
func (*Malscraper) GetMangaReview ¶
GetMangaReview to get manga review list.
func (*Malscraper) GetMangaReviews ¶
GetMangaReviews to get manga review list.
func (*Malscraper) GetMangaStats ¶
GetMangaStats to get manga stats list.
func (*Malscraper) GetMangaWithGenre ¶
GetMangaWithGenre to get manga list with specific genre.
func (*Malscraper) GetNews ¶
GetNews to get news detail information.
Example: https://myanimelist.net/news/34036779.
func (*Malscraper) GetNewsList ¶
func (m *Malscraper) GetNewsList(pageTag ...interface{}) ([]model.NewsItem, int, error)
GetNewsList to get news list.
Tag should be from `GetNewsTag()`.
Example: https://myanimelist.net/news.
func (*Malscraper) GetNewsTag ¶
func (m *Malscraper) GetNewsTag() (*model.NewsTag, int, error)
GetNewsTag to get news tag list.
Example: https://myanimelist.net/news/tag.
func (*Malscraper) GetPeople ¶
GetPeople to get people detail information.
Example: https://myanimelist.net/people/1.
func (*Malscraper) GetPeopleArticle ¶
func (m *Malscraper) GetPeopleArticle(id int) ([]model.ArticleItem, int, error)
GetPeopleArticle to get people featured article list.
Example: https://myanimelist.net/people/185/Kana_Hanazawa/featured.
func (*Malscraper) GetPeopleCharacter ¶
func (m *Malscraper) GetPeopleCharacter(id int) ([]model.PeopleCharacter, int, error)
GetPeopleCharacter to get people anime character list.
Example: https://myanimelist.net/people/1.
func (*Malscraper) GetPeopleManga ¶
GetPeopleManga to get people published manga list.
Example: https://myanimelist.net/people/1868.
func (*Malscraper) GetPeopleNews ¶
GetPeopleNews to get people news list.
Example: https://myanimelist.net/people/1/Tomokazu_Seki/news.
func (*Malscraper) GetPeoplePicture ¶
func (m *Malscraper) GetPeoplePicture(id int) ([]string, int, error)
GetPeoplePicture to get people picture list.
Example: https://myanimelist.net/people/1/Tomokazu_Seki/pictures.
func (*Malscraper) GetPeopleStaff ¶
GetPeopleStaff to get people anime staff list.
Example: https://myanimelist.net/people/1.
func (*Malscraper) GetProducer ¶
GetProducer to get producer anime list.
Example: https://myanimelist.net/anime/producer/1/Studio_Pierrot.
func (*Malscraper) GetProducers ¶
func (m *Malscraper) GetProducers() ([]model.ItemCount, int, error)
GetProducers to get anime producer/studio/licensor list.
Example: https://myanimelist.net/anime/producer.
func (*Malscraper) GetRecommendation ¶
func (m *Malscraper) GetRecommendation(_type int, id1, id2 int) (*model.Recommendation, int, error)
GetRecommendation to get anime/manga recommendation detail information.
Param `_type` should be one of these constants.
AnimeType MangaType
Or just use method `GetRecommendationAnime()` or `GetRecommendationManga()`.
func (*Malscraper) GetRecommendationAnime ¶
func (m *Malscraper) GetRecommendationAnime(id1, id2 int) (*model.Recommendation, int, error)
GetRecommendationAnime to get anime recommendation.
Example: https://myanimelist.net/recommendations/anime/1-205.
func (*Malscraper) GetRecommendationManga ¶
func (m *Malscraper) GetRecommendationManga(id1, id2 int) (*model.Recommendation, int, error)
GetRecommendationManga to get manga recommendation.
Example: https://myanimelist.net/recommendations/manga/1-21.
func (*Malscraper) GetRecommendations ¶
func (m *Malscraper) GetRecommendations(_type int, page ...int) ([]model.Recommendation, int, error)
GetRecommendations to get anime/manga recommendation list.
Param `_type` should be one of these constants.
AnimeType MangaType
Or just use method `GetAnimeRecommendations()` or `GetMangaRecommendations()`.
func (*Malscraper) GetReview ¶
GetReview to get review detail information.
Example: https://myanimelist.net/reviews.php?id=1.
func (*Malscraper) GetReviews ¶
GetReviews to get anime/manga/best review list.
Param `_type` should be one of these constants.
AnimeReview MangaReview BestReview
Or just use method `GetAnimeReviews()`, `GetMangaReviews()` or `GetBestReviews()`.
func (*Malscraper) GetSeason ¶
func (m *Malscraper) GetSeason(seasonYear ...interface{}) ([]model.AnimeItem, int, error)
GetSeason to get seasonal anime list.
Season should be one of these constants.
Winter Spring Summer Fall
Example: https://myanimelist.net/anime/season.
func (*Malscraper) GetTopAnime ¶
GetTopAnime to get top anime list.
Type should be one of these constants.
TopDefault TopAiring TopUpcoming TopTV TopMovie TopOVA TopONA TopSpecial TopPopularAnime TopFavoriteAnime
Example: https://myanimelist.net/topanime.php.
func (*Malscraper) GetTopCharacter ¶
func (m *Malscraper) GetTopCharacter(page ...int) ([]model.TopCharacter, int, error)
GetTopCharacter to get top character list.
Example: https://myanimelist.net/character.php.
func (*Malscraper) GetTopManga ¶
GetTopManga to get top manga list.
Type should be one of these constants.
TopDefault TopManga TopNovel TopOneshot TopDoujin TopManhwa TopManhua TopPopularManga TopFavoriteManga
Example: https://mymangalist.net/topmanga.php.
func (*Malscraper) GetTopPeople ¶
GetTopPeople to get top people list.
Example: https://myanimelist.net/people.php.
func (*Malscraper) GetUser ¶
GetUser to get user detail information.
Example: https://myanimelist.net/profile/rl404.
func (*Malscraper) GetUserAnime ¶
GetUserAnime to quick get user anime list.
Example: https://myanimelist.net/animelist/rl404.
func (*Malscraper) GetUserAnimeAdv ¶
func (m *Malscraper) GetUserAnimeAdv(query model.UserListQuery) ([]model.UserAnime, int, error)
GetUserAnimeAdv to get user anime list.
Available constant options.
Status Order --------------- ------------------- StatusDefault OrderDefault StatusCurrent OrderAnimeTitle StatusCompleted OrderAnimeFinishDate StatusOnHold OrderAnimeStartDate StatusDropped OrderAnimeScore StatusPlanned OrderAnimeType StatusAll OrderAnimeRated OrderAnimePriority OrderAnimeProgress OrderAnimeStorage OrderAnimeAirStart OrderAnimeAirEnd
Example: https://myanimelist.net/animelist/rl404.
func (*Malscraper) GetUserClub ¶
GetUserClub to get user club list.
func (*Malscraper) GetUserFavorite ¶
func (m *Malscraper) GetUserFavorite(username string) (*model.UserFavorite, int, error)
GetUserFavorite to get user favorite list.
Example: https://myanimelist.net/profile/rl404.
func (*Malscraper) GetUserFriend ¶
func (m *Malscraper) GetUserFriend(username string, page ...int) ([]model.UserFriend, int, error)
GetUserFriend to get user friend list.
func (*Malscraper) GetUserHistory ¶
func (m *Malscraper) GetUserHistory(username string, _type ...int) ([]model.UserHistory, int, error)
GetUserHistory to get user history list.
Type should be one of these constants.
AllType AnimeType MangaType
Example: https://myanimelist.net/history/rl404.
func (*Malscraper) GetUserManga ¶
GetUserManga to quick get user manga list.
Example: https://myanimelist.net/mangalist/rl404.
func (*Malscraper) GetUserMangaAdv ¶
func (m *Malscraper) GetUserMangaAdv(query model.UserListQuery) ([]model.UserManga, int, error)
GetUserMangaAdv to get user manga list.
Available constant options.
Status Order --------------- ------------------- StatusDefault OrderDefault StatusCurrent OrderMangaTitle StatusCompleted OrderMangaFinishDate StatusOnHold OrderMangaStartDate StatusDropped OrderMangaScore StatusPlanned OrderMangaPriority StatusAll OrderMangaChapter OrderMangaVolume OrderMangaType OrderMangaPublishStart OrderMangaPublishEnd
Example: https://myanimelist.net/mangalist/rl404.
func (*Malscraper) GetUserRecommendation ¶
func (m *Malscraper) GetUserRecommendation(username string, page ...int) ([]model.Recommendation, int, error)
GetUserRecommendation to get user recommendation list.
Example: https://myanimelist.net/profile/Archaeon/recommendations.
func (*Malscraper) GetUserReview ¶
GetUserReview to get user review list.
func (*Malscraper) GetUserStats ¶
GetUserStats to get user stats detail information.
Example: https://myanimelist.net/profile/rl404.
func (*Malscraper) SearchAnime ¶
func (m *Malscraper) SearchAnime(title string, page ...int) ([]model.AnimeSearch, int, error)
SearchAnime to quick search anime.
func (*Malscraper) SearchCharacter ¶
func (m *Malscraper) SearchCharacter(name string, page ...int) ([]model.CharacterSearch, int, error)
SearchCharacter to search character.
func (*Malscraper) SearchClub ¶
func (m *Malscraper) SearchClub(name string, page ...int) ([]model.ClubSearch, int, error)
SearchClub to quick search club.
Example: https://myanimelist.net/clubs.php?cat=club&catid=0&q=naruto&action=find.
func (*Malscraper) SearchManga ¶
func (m *Malscraper) SearchManga(title string, page ...int) ([]model.MangaSearch, int, error)
SearchManga to quick search manga.
func (*Malscraper) SearchPeople ¶
func (m *Malscraper) SearchPeople(name string, page ...int) ([]model.PeopleSearch, int, error)
SearchPeople to search people.
func (*Malscraper) SearchUser ¶
func (m *Malscraper) SearchUser(username string, page ...int) ([]model.UserSearch, int, error)
SearchUser to quick search user.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package errors contains all errors returned by malscraper.
|
Package errors contains all errors returned by malscraper. |
Package model contains all models for malscraper.
|
Package model contains all models for malscraper. |
pkg
|
|
utils
Package utils provides general helper functions for malscraper.
|
Package utils provides general helper functions for malscraper. |