Skip to content

Commit

Permalink
feat: rebranded mod.land targets from types definitions (#21)
Browse files Browse the repository at this point in the history
* proper hentaifox img url

* fix apidocs definitions

* add getServer mocks
  • Loading branch information
sinkaroid authored Apr 11, 2023
1 parent d56567d commit 154bb8e
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 82 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<a href="https://janda.mod.land"><img width="500" src="https://cdn.discordapp.com/attachments/1046495201176334467/1055678255866318898/tomoe-janda.png" alt="jandapress"></a>
<a href="https://janda.sinkaroid.org"><img width="500" src="https://cdn.discordapp.com/attachments/1046495201176334467/1055678255866318898/tomoe-janda.png" alt="jandapress"></a>

<h4 align="center">RESTful and experimental API for the doujinboards</h4>
<p align="center">
Expand All @@ -17,7 +17,7 @@ The motivation of this project is to bring you an actionable data related doujin

---

<a href="https://janda.mod.land"><img align="right" src="https://cdn.discordapp.com/attachments/952117487166705747/986315079802814524/tomoe.png" width="300"></a>
<a href="https://janda.sinkaroid.org"><img align="right" src="https://cdn.discordapp.com/attachments/952117487166705747/986315079802814524/tomoe.png" width="300"></a>

- [Jandapress](#)
- [The problem](#the-problem)
Expand Down Expand Up @@ -196,8 +196,8 @@ The missing piece of nhentai.net - https://sinkaroid.github.io/jandapress/#api-n
- <u>sort parameters on search</u>
- "popular-today", "popular-week", "popular"
- Example
- https://janda.mod.land/nhentai/get?book=177013
- https://janda.mod.land/nhentai/search?key=futanari&page=2&sort=popular-today
- https://janda.sinkaroid.org/nhentai/get?book=177013
- https://janda.sinkaroid.org/nhentai/search?key=futanari&page=2&sort=popular-today

### Pururin
The missing piece of pururin.to - https://sinkaroid.github.io/jandapress/#api-pururin
Expand All @@ -208,8 +208,8 @@ The missing piece of pururin.to - https://sinkaroid.github.io/jandapress/#api-pu
- <u>sort parameters on search</u>
- "newest", "most-popular", "highest-rated", "most-viewed", "title", "random"
- Example
- https://janda.mod.land/pururin/get?book=63373
- https://janda.mod.land/pururin/search?key=futanari&page=2&sort=most-viewed
- https://janda.sinkaroid.org/pururin/get?book=63373
- https://janda.sinkaroid.org/pururin/search?key=futanari&page=2&sort=most-viewed

### Hentaifox
The missing piece of hentaifox.com - https://sinkaroid.github.io/jandapress/#api-hentaifox
Expand All @@ -220,8 +220,8 @@ The missing piece of hentaifox.com - https://sinkaroid.github.io/jandapress/#api
- <u>sort parameters on search</u>
- "latest", "popular"
- Example
- https://janda.mod.land/hentaifox/get?book=97527
- https://janda.mod.land/hentaifox/search?key=milf&page=2&sort=latest
- https://janda.sinkaroid.org/hentaifox/get?book=97527
- https://janda.sinkaroid.org/hentaifox/search?key=milf&page=2&sort=latest

### Asmhentai
The missing piece of asmhentai.com - https://sinkaroid.github.io/jandapress/#api-asmhentai
Expand All @@ -232,8 +232,8 @@ The missing piece of asmhentai.com - https://sinkaroid.github.io/jandapress/#api
- <u>sort parameters on search</u>
- None
- Example
- https://janda.mod.land/asmhentai/get?book=416773
- https://janda.mod.land/asmhentai/search?key=futanari&page=2
- https://janda.sinkaroid.org/asmhentai/get?book=416773
- https://janda.sinkaroid.org/asmhentai/search?key=futanari&page=2

### Hentai2read
The missing piece of hentai2read.com - https://sinkaroid.github.io/jandapress/#api-hentai2read
Expand All @@ -243,8 +243,8 @@ The missing piece of hentai2read.com - https://sinkaroid.github.io/jandapress/#a
- <u>sort parameters on search</u>
- TBA
- Example
- https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1
- https://janda.mod.land/hentai2read/search?key=futanari
- https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1
- https://janda.sinkaroid.org/hentai2read/search?key=futanari

### Simply-hentai
The missing piece of simply-hentai.com - https://sinkaroid.github.io/jandapress/#api-simply-hentai
Expand All @@ -253,7 +253,7 @@ The missing piece of simply-hentai.com - https://sinkaroid.github.io/jandapress/
- <u>sort parameters on search</u>
- TBA
- Example
- https://janda.mod.land/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages
- https://janda.sinkaroid.org/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages

### 3hentai
The missing piece of 3hentai.net - https://sinkaroid.github.io/jandapress/#api-3hentai
Expand All @@ -264,8 +264,8 @@ The missing piece of 3hentai.net - https://sinkaroid.github.io/jandapress/#api-3
- <u>sort parameters on search</u>
- "recent", "popular-24h", "popular-7d", "popular"
- Example
- https://janda.mod.land/3hentai/get?book=608979
- https://janda.mod.land/3hentai/search?key=futanari&page=2&sort=popular-7d
- https://janda.sinkaroid.org/3hentai/get?book=608979
- https://janda.sinkaroid.org/3hentai/search?key=futanari&page=2&sort=popular-7d

## Status response
`"success": true,` or `"success": false,`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"apidoc": {
"title": "Jandapress API Documentation",
"url": "https://janda.mod.land",
"sampleUrl": "https://janda.mod.land",
"url": "https://janda.sinkaroid.org",
"sampleUrl": "https://janda.sinkaroid.org",
"name": "Jandapress"
},
"keywords": [],
Expand Down
12 changes: 11 additions & 1 deletion src/JandaPress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import p from "phin";
import p, { IResponse } from "phin";
import Keyv from "keyv";
import { CookieJar } from "tough-cookie";
import { HttpsCookieAgent } from "http-cookie-agent/http";
Expand Down Expand Up @@ -131,6 +131,16 @@ class JandaPress {
heap: `${Math.round(heap * 100) / 100}/${Math.round(heaptotal * 100) / 100} MB`
};
}

async getServer(): Promise<string> {
const raw = await p({
"url": "http://ip-api.com/json",
"parse": "json"
}) as IResponse;
const data = raw.body as unknown as { country: string, regionName: string };
return `${data.country}, ${data.regionName}`;

}
}

export default JandaPress;
6 changes: 3 additions & 3 deletions src/controller/3hentai/3hentaiGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export async function get3hentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/3hentai/get?book=123
* curl -i https://janda.sinkaroid.org/3hentai/get?book=123
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/3hentai/get?book=123")
* axios.get("https://janda.sinkaroid.org/3hentai/get?book=123")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/3hentai/get?book=123") as resp:
* async with session.get("https://janda.sinkaroid.org/3hentai/get?book=123") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/3hentai/3hentaiRandom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export async function random3hentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/3hentai/random
* curl -i https://janda.sinkaroid.org/3hentai/random
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/3hentai/random")
* axios.get("https://janda.sinkaroid.org/3hentai/random")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/3hentai/random") as resp:
* async with session.get("https://janda.sinkaroid.org/3hentai/random") as resp:
* print(await resp.json())
*
*/
Expand Down
8 changes: 4 additions & 4 deletions src/controller/3hentai/3hentaiSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ export async function search3hentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/3hentai/search?key=yuri
* curl -i https://janda.mod.land/3hentai/search?key=yuri&page=2&sort=recent
* curl -i https://janda.sinkaroid.org/3hentai/search?key=yuri
* curl -i https://janda.sinkaroid.org/3hentai/search?key=yuri&page=2&sort=recent
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/3hentai/search?key=yuri")
* axios.get("https://janda.sinkaroid.org/3hentai/search?key=yuri")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/3hentai/search?key=yuri") as resp:
* async with session.get("https://janda.sinkaroid.org/3hentai/search?key=yuri") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/asmhentai/asmhentaiGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export async function getAsmhentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/asmhentai/get?book=123
* curl -i https://janda.sinkaroid.org/asmhentai/get?book=123
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/asmhentai/get?book=123")
* axios.get("https://janda.sinkaroid.org/asmhentai/get?book=123")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/asmhentai/get?book=123") as resp:
* async with session.get("https://janda.sinkaroid.org/asmhentai/get?book=123") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/asmhentai/asmhentaiRandom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export async function randomAsmhentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/asmhentai/random
* curl -i https://janda.sinkaroid.org/asmhentai/random
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/asmhentai/random")
* axios.get("https://janda.sinkaroid.org/asmhentai/random")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/asmhentai/random") as resp:
* async with session.get("https://janda.sinkaroid.org/asmhentai/random") as resp:
* print(await resp.json())
*
*/
Expand Down
6 changes: 3 additions & 3 deletions src/controller/asmhentai/asmhentaiSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ export async function searchAsmhentai(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/asmhentai/search?key=yuri
* curl -i https://janda.sinkaroid.org/asmhentai/search?key=yuri
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/asmhentai/search?key=yuri")
* axios.get("https://janda.sinkaroid.org/asmhentai/search?key=yuri")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/asmhentai/search?key=yuri") as resp:
* async with session.get("https://janda.sinkaroid.org/asmhentai/search?key=yuri") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/hentai2read/hentai2readGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export async function getHentai2read(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1
* curl -i https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1")
* axios.get("https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") as resp:
* async with session.get("https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/hentai2read/hentai2readSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ export async function searchHentai2read(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/hentai2read/search?key=yuri
* curl -i https://janda.sinkaroid.org/hentai2read/search?key=yuri
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/hentai2read/search?key=yuri")
* axios.get("https://janda.sinkaroid.org/hentai2read/search?key=yuri")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/hentai2read/search?key=yuri") as resp:
* async with session.get("https://janda.sinkaroid.org/hentai2read/search?key=yuri") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/hentaifox/hentaifoxGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export async function getHentaifox(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/hentaifox/get?book=123
* curl -i https://janda.sinkaroid.org/hentaifox/get?book=123
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/hentaifox/get?book=123")
* axios.get("https://janda.sinkaroid.org/hentaifox/get?book=123")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/hentaifox/get?book=123") as resp:
* async with session.get("https://janda.sinkaroid.org/hentaifox/get?book=123") as resp:
* print(await resp.json())
*/

Expand Down
6 changes: 3 additions & 3 deletions src/controller/hentaifox/hentaifoxRandom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export async function randomHentaifox(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/hentaifox/random
* curl -i https://janda.sinkaroid.org/hentaifox/random
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/hentaifox/random")
* axios.get("https://janda.sinkaroid.org/hentaifox/random")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/hentaifox/random") as resp:
* async with session.get("https://janda.sinkaroid.org/hentaifox/random") as resp:
* print(await resp.json())
*
*/
Expand Down
8 changes: 4 additions & 4 deletions src/controller/hentaifox/hentaifoxSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ export async function searchHentaifox(req: Request, res: Response) {
* HTTP/1.1 400 Bad Request
*
* @apiExample {curl} curl
* curl -i https://janda.mod.land/hentaifox/search?key=yuri
* curl -i https://janda.mod.land/hentaifox/search?key=yuri&page=2&sort=latest
* curl -i https://janda.sinkaroid.org/hentaifox/search?key=yuri
* curl -i https://janda.sinkaroid.org/hentaifox/search?key=yuri&page=2&sort=latest
*
* @apiExample {js} JS/TS
* import axios from "axios"
*
* axios.get("https://janda.mod.land/hentaifox/search?key=yuri")
* axios.get("https://janda.sinkaroid.org/hentaifox/search?key=yuri")
* .then(res => console.log(res.data))
* .catch(err => console.error(err))
*
* @apiExample {python} Python
* import aiohttp
* async with aiohttp.ClientSession() as session:
* async with session.get("https://janda.mod.land/hentaifox/search?key=yuri") as resp:
* async with session.get("https://janda.sinkaroid.org/hentaifox/search?key=yuri") as resp:
* print(await resp.json())
*/

Expand Down
Loading

0 comments on commit 154bb8e

Please sign in to comment.