From 3c660fb81c3f232d897a51f4b431a523aabf15df Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Fri, 4 Oct 2024 19:50:54 +0530 Subject: [PATCH] docs: update scraper documentation --- README.md | 92 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 23926e0..8994142 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,12 @@ pnpm add aniwatch Example - getting information about an anime by providing it's unique anime id, using anime [Steins;Gate](https://www.imdb.com/title/tt1910272/) with `steinsgate-3` unique anime id as an example. ```javascript -import { getAnimeAboutInfo } from "aniwatch"; +import { HiAnime } from "aniwatch"; -getAnimeAboutInfo("steinsgate-3") +const hianime = new HiAnime.Scraper(); + +hianime + .getInfo("steinsgate-3") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -114,9 +117,12 @@ getAnimeAboutInfo("steinsgate-3") #### Sample Usage ```typescript -import { getHomePage } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getHomePage() +hianime + .getHomePage() .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -269,9 +275,12 @@ getHomePage() #### Sample Usage ```javascript -import { getAnimeAboutInfo } from "aniwatch"; +import { HiAnime } from "aniwatch"; -getAnimeAboutInfo("steinsgate-3") +const hianime = new HiAnime.Scraper(); + +hianime + .getInfo("steinsgate-3") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -424,11 +433,14 @@ getAnimeAboutInfo("steinsgate-3") #### Sample Usage ```javascript -import { getAnimeSearchResults } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getAnimeSearchResults("monster", 1, { - genres: "seinen,psychological", -}) +hianime + .search("monster", 1, { + genres: "seinen,psychological", + }) .then((data) => { console.log(data); }) @@ -502,9 +514,12 @@ getAnimeSearchResults("monster", 1, { #### Sample Usage ```javascript -import { getAnimeSearchSuggestion } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getAnimeSearchSuggestion("one piece") +hianime + .searchSuggestions("one piece") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -548,9 +563,12 @@ getAnimeSearchSuggestion("one piece") #### Sample Usage ```javascript -import { getProducerAnimes } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getProducerAnimes("toei-animation", 2) +hianime + .getProducerAnimes("toei-animation", 2) .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -634,8 +652,12 @@ getProducerAnimes("toei-animation", 2) #### Sample Usage ```javascript -import { getGenreAnime } from "aniwatch"; -getGenreAnime("shounen", 2) +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); + +hianime + .getGenreAnime("shounen", 2) .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -703,9 +725,12 @@ getGenreAnime("shounen", 2) #### Sample Usage ```javascript -import { getAnimeCategory } from "aniwatch"; +import { HiAnime } from "aniwatch"; -getAnimeCategory("subbed-anime") +const hianime = new HiAnime.Scraper(); + +hianime + .getCategoryAnime("subbed-anime") .then((data) => console.log(data)) .catch((err) => console.error(err)); @@ -780,9 +805,12 @@ getAnimeCategory("subbed-anime") #### Sample Usage ```javascript -import { getEstimatedSchedule } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getEstimatedSchedule("2024-08-09") +hianime + .getEstimatedSchedule("2024-08-09") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -826,9 +854,12 @@ getEstimatedSchedule("2024-08-09") #### Sample Usage ```javascript -import { getAnimeEpisodes } from "aniwatch"; +import { HiAnime } from "aniwatch"; -getAnimeEpisodes("steinsgate-3") +const hianime = new HiAnime.Scraper(); + +hianime + .getEpisodes("steinsgate-3") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -871,9 +902,12 @@ getAnimeEpisodes("steinsgate-3") #### Request sample ```javascript -import { getEpisodeServers } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getEpisodeServers("steinsgate-0-92?ep=2055") +hianime + .getEpisodeServers("steinsgate-0-92?ep=2055") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -931,9 +965,12 @@ getEpisodeServers("steinsgate-0-92?ep=2055") #### Request sample ```javascript -import { getAnimeEpisodeSources } from "aniwatch"; +import { HiAnime } from "aniwatch"; + +const hianime = new HiAnime.Scraper(); -getAnimeEpisodeSources("steinsgate-3?ep=230", "hd-1", "sub") +hianime + .getEpisodeSources("steinsgate-3?ep=230", "hd-1", "sub") .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` @@ -995,9 +1032,10 @@ Don't forget to leave a star 🌟. You can also follow me on X (Twitter) [@rites This project is licensed under the [MIT License](https://opensource.org/license/mit/) - see the [LICENSE](https://github.com/ghoshRitesh12/aniwatch/blob/main/LICENSE) file for more details. --> +/>