Skip to content

Commit

Permalink
Add Anime News Network provider (#70)
Browse files Browse the repository at this point in the history
* feat: animenewsnetwork

* chore: update getNewsFeeds parameters

* Added animenewsnetwork tests & improved QOL
  • Loading branch information
LuckyYam authored Aug 27, 2022
1 parent 8f8d203 commit 779b703
Show file tree
Hide file tree
Showing 42 changed files with 3,180 additions and 2,449 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Do you want to know more? Head to the [`Getting Started`](https://github.com/con
- [`Light Novels`](./docs/guides/light-novels.md)
- [`Comics`](./docs/guides/comics.md)
- [`Meta`](./docs/guides/meta.md)
- [`News`](./docs/guides/news.md)

## Ecosystem
- [Rest-API Reference](https://docs.consumet.org/) - public rest api documentation
Expand All @@ -110,9 +111,9 @@ You can contact the maintainers of consumet.ts via [email](mailto:consumet.org@g
</a>

## Contributors ✨
Thanks to the following people who have contributed to this repo:
Thanks to the following people for keeping this project alive and thriving.

[![](https://avatars.githubusercontent.com/u/57333995?s=50)](https://github.com/riimuru) [![](https://avatars.githubusercontent.com/u/80477926?s=50)](https://github.com/prince-ao) [![](https://avatars.githubusercontent.com/u/98132263?s=50)](https://github.com/JLdev0) [![](https://avatars.githubusercontent.com/u/48152635?s=50)](https://github.com/notSagyo) [![](https://avatars.githubusercontent.com/u/23521035?s=50)](https://github.com/vanelk) [![](https://avatars.githubusercontent.com/u/53954981?s=50)](https://github.com/aidanjuma) [![](https://avatars.githubusercontent.com/u/33759526?s=50)](https://github.com/5H4D0WILA)
[![](https://avatars.githubusercontent.com/u/57333995?s=50)](https://github.com/riimuru) [![](https://avatars.githubusercontent.com/u/80477926?s=50)](https://github.com/prince-ao) [![](https://avatars.githubusercontent.com/u/98132263?s=50)](https://github.com/JLdev0) [![](https://avatars.githubusercontent.com/u/48152635?s=50)](https://github.com/notSagyo) [![](https://avatars.githubusercontent.com/u/23521035?s=50)](https://github.com/vanelk) [![](https://avatars.githubusercontent.com/u/53954981?s=50)](https://github.com/aidanjuma) [![](https://avatars.githubusercontent.com/u/33759526?s=50)](https://github.com/5H4D0WILA) [![](https://avatars.githubusercontent.com/u/85594230?s=50)](https://github.com/LuckyYam)

## License
Licensed under [MIT](./LICENSE).
6 changes: 4 additions & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ANIME, BOOKS, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META } from './providers';
import { ANIME, BOOKS, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META, NEWS } from './providers';
import { PROVIDERS_LIST } from './utils/providers-list';
export { ANIME, BOOKS, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META };
import { Topics, Genres, SubOrSub, StreamingServers, MediaStatus } from './models';
export { ANIME, BOOKS, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
export { PROVIDERS_LIST };
export { Topics, Genres, SubOrSub, StreamingServers, MediaStatus };
9 changes: 8 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import VideoExtractor from './video-extractor';
import MangaParser from './manga-parser';
import LightNovelParser from './lightnovel-parser';
import MovieParser from './movie-parser';
import { IProviderStats, ISearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, LibgenBook, StreamingServers, MediaStatus, SubOrSub, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, GetComicsComics, ComicRes, ZLibrary, IMangaChapterPage, TvType, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres } from './types';
import NewsParser from './news-parser';
import { IProviderStats, ISearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, LibgenBook, StreamingServers, MediaStatus, SubOrSub, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, GetComicsComics, ComicRes, ZLibrary, IMangaChapterPage, TvType, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo } from './types';
import { LibgenBookObject, GetComicsComicsObject, ZLibraryObject } from './type-objects';
export { BaseProvider, IProviderStats, BaseParser, AnimeParser, BookParser, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, VideoExtractor, LibgenBook, LibgenBookObject, StreamingServers, MediaStatus, SubOrSub, LightNovelParser, MangaParser, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, ComicParser, GetComicsComics, GetComicsComicsObject, ComicRes, ZLibrary, ZLibraryObject, ISearch, IMangaChapterPage, TvType, MovieParser, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, };
export { BaseProvider, IProviderStats, BaseParser, AnimeParser, BookParser, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, VideoExtractor, LibgenBook, LibgenBookObject, StreamingServers, MediaStatus, SubOrSub, LightNovelParser, MangaParser, NewsParser, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, ComicParser, GetComicsComics, GetComicsComicsObject, ComicRes, ZLibrary, ZLibraryObject, ISearch, IMangaChapterPage, TvType, MovieParser, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo };
5 changes: 4 additions & 1 deletion dist/models/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/models/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/models/news-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { BaseProvider } from '.';
declare abstract class NewsParser extends BaseProvider {
}
export default NewsParser;
7 changes: 7 additions & 0 deletions dist/models/news-parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/models/news-parser.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions dist/models/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,36 @@ export interface IMovieResult {
type?: TvType;
[x: string]: unknown;
}
export interface INewsFeed extends INews {
/** topics of the feed */
topics: Topics[];
/** preview of the news feed */
preview: INewsFeedPreview;
}
export interface INewsInfo extends INews {
/** intro of the news */
intro: string;
/** description of the news */
description: string;
}
interface INews {
/** id of the news */
id: string;
/** title of the news */
title: string;
/** time at which the news was uploaded */
uploadedAt: string;
/** thumbnail image URL of the news */
thumbnail: string;
/** URL of the news */
url: string;
}
interface INewsFeedPreview {
/** intro of the feed */
intro: string;
/** some contents of the feed */
full: string;
}
export interface IMovieInfo extends IMovieResult {
genres?: string[];
description?: string;
Expand Down Expand Up @@ -281,3 +311,18 @@ export declare enum Genres {
SUPERNATURAL = "Supernatural",
THRILLER = "Thriller"
}
export declare enum Topics {
ANIME = "anime",
ANIMATION = "animation",
MANGA = "manga",
GAMES = "games",
NOVELS = "novels",
LIVE_ACTION = "live-action",
COVID_19 = "covid-19",
INDUSTRY = "industry",
MUSIC = "music",
PEOPLE = "people",
MERCH = "merch",
EVENTS = "events"
}
export {};
17 changes: 16 additions & 1 deletion dist/models/types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/models/types.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/anime/gogoanime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare class Gogoanime extends AnimeParser {
search: (query: string, page?: number) => Promise<ISearch<IAnimeResult>>;
/**
*
* @param animeUrl anime id
* @param id anime id
*/
fetchAnimeInfo: (id: string) => Promise<IAnimeInfo>;
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/providers/anime/gogoanime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/providers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import BOOKS from './books';
import COMICS from './comics';
import MOVIES from './movies';
import META from './meta';
export { ANIME, MANGA, BOOKS, COMICS, LIGHT_NOVELS, MOVIES, META };
import NEWS from './news';
export { ANIME, MANGA, BOOKS, COMICS, LIGHT_NOVELS, MOVIES, META, NEWS };
4 changes: 3 additions & 1 deletion dist/providers/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 779b703

Please sign in to comment.