From 211888b8a396df8d5166afba85af54e0240015c1 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 13 Aug 2023 11:54:33 +0530 Subject: removed MAL2Go documentation --- content/docs/mal2go/v4/manga/search-for-a-manga.md | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 content/docs/mal2go/v4/manga/search-for-a-manga.md (limited to 'content/docs/mal2go/v4/manga/search-for-a-manga.md') diff --git a/content/docs/mal2go/v4/manga/search-for-a-manga.md b/content/docs/mal2go/v4/manga/search-for-a-manga.md deleted file mode 100644 index 3d28ef4..0000000 --- a/content/docs/mal2go/v4/manga/search-for-a-manga.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "Search for a manga" -description: "Use a search string to get a list of mangas" -weight: 2 ---- - -Use the `SearchManga` method to search for a manga. This method takes these arguments: - -- `searchString string` Is pretty obvious. This term is used to search for a manga on MyAnimeList. -- `limit int` Is the max amount of search results to get. Max is 100. -- `offset int` Is the "offset" for the search results. If offset is greater than 0 the first n number of search reults will be ignored. -- `nsfw bool` Wether to include NSFW rated search results -- `fields []string` The fields to include in the search results. [Here]() is a list of the valid fields. Just using an empty slice (`[]string{}`) will include all the fields. -The MyAnimeList API is picky about what fields to actually include with search results. To be sure that you are getting all the data it is recommended to use the [`GetMangaById`](/docs/mal2go/v4/manga/get-manga-by-id/) method which ensures that all the required fields are included. - - -Example: - -``` go -package main - -import ( - "github.com/MikunoNaka/MAL2Go/v4/manga" - "log" - "fmt" -) - -func main() { - authToken := "YOUR_TOKEN_HERE" - myClient := manga.Client { - AuthToken: "Bearer " + authToken, - } - - searchString := "mushishi" // search for mushishi - limit := 10 // get 10 search results - offset := 0 // no offset - searchNsfw := false // don't include NSFW results - fields := []string{"title"} // only pull the title - - searchResults, err := myClient.SearchManga(searchString, limit, offset, searchNsfw, fields) - if err != nil { - log.Fatal(err) // remember kids, always handle errors - } - - // loop over the search results and print the title - for _, manga := range searchResults { - fmt.Println(manga.Title) - } -} -``` - -- cgit v1.2.3