Go to file
Millennium Earl 08bb565761
Update README.md
2020-11-08 18:52:13 +01:00
.github/workflows Create codeql-analysis.yml 2020-10-02 16:48:16 +02:00
.vscode New functions 2020-10-01 21:13:23 +02:00
app Update example.js 2020-11-07 18:58:06 +01:00
test Removed debug option and added logger level 2020-11-02 15:26:06 +01:00
.deepsource.toml Update .deepsource.toml 2020-11-02 16:32:59 +01:00
.eslintrc.json Validated eslintrc.json 2020-11-04 15:13:23 +05:30
.gitattributes Initial commit 2020-09-26 13:37:43 +02:00
.gitignore Fixed unit tests, better game search and improved speed 2020-10-12 14:11:36 +02:00
README.md Update README.md 2020-11-08 18:52:13 +01:00
coverage.lcov Updated test coverage 2020-11-02 16:27:04 +01:00
package-lock.json Updated test coverage 2020-11-02 16:27:04 +01:00
package.json Updated package version 2020-11-07 18:42:59 +01:00

README.md

DeepSource CodeFactor FOSSA Status Known Vulnerabilities codecov

F95API

Unofficial Node JS module for scraping F95Zone platform

These APIs have been developed to support this application and allow you to obtain data on games and mods on the platform F95zone (NSFW)

A simple usage example can be found in app/example.js

Attention: Two-factor authentication is not supported

Data scraping

Games/mods can be obtained by name or URL

// The name is case insensitive
let listOfFoundGames = await F95API.getGameData("your game name");
let listOfFoundMods = await F95API.getGameData("your mod name", true);

let specificGame = await F95API.getGameDataFromURL("the URL of your game");

While user data (after authenticating) with

let authResult = await F95API.login(username, password);

let loggedUserData = await F95API.getUserData();

Classes

Games and mods

Information about games and mods is stored in a GameInfo object with the following fields:

name: The game name
author: The game developer
url: The URL that leads to the game thread on F95Zone
overview: Description of the game
language: Main language of the game
supportedOS: List of supported OS (Windows/Linux/Mac/Android...)
censored: Are the NSFW parts censored?
engine: Game engine (Unity, Ren'Py, RPGM...)
status: Completed/Abandoned/Ongoing/Onhold
tags: List of tags
previewSrc: Source URL of the game description image
version: Version of the game
lastUpdate: Date of the last update (it's a Date object)
isMod: Is it a game or a mod?
changelog: Latest changelog available

The serialization in JSON format of this object is possible through JSON.stringfy() while the deserialization must happen through the static method GameInfo.fromJSON().

User data

User data (after authentication) can be stored in a UserData object, consisting of the following fields:

username: Name of the logged in user
avatarSrc: Source URL of the user's profile picture
watchedThreads: List of URLs of threads followed by the user

Login results

The outcome of the authentication process is represented by the LoginResult object:

success: Was the authentication successful?;ì
message: Possible error message (unrecognized user, wrong password...) or authentication successful message

Logging

To log the behavior of the application log4js is used with a default level of "warn". This option can be changed with the loggerLevel property.

Guidelines for errors

  • If you can, return a meaningful value
  • Return null only if the function should return a complex object (including strings)
  • Return an empty array if the function should return an array
  • Return false, -1 when the function should retrn boolean or number
  • Throw an exception only if it is an error or if a wrong value could mess up the functioning of the library