Giter Club home page Giter Club logo

tcb-opus's Issues

Make website scraping optional

3 modes:

  • Simple: Only post a notification message without a link to the direct chapter
  • Direct Link: Takes the existing link from the original Discord message and embed it in the notification message
  • Scraping: In case a direct link to the chapter page is missing, uses the manga name to search and scrape the TCB website

Use Regex to always parse the URL correctly

Sometimes, TCB change the way their URL look by adding additional parts at the end.
Despite that, here is what the URL should always look like:
https://onepiecechapters.com/chapters/{Id}/{mangaName}-chapter-{chapNum}{suffix}

The {chapNum} is the one thing we care about and it should always be an integer.

Replace require("data.json") by readFile

The data.json is not present on Git by default and must be created in order for the bot to run because of require("data.json").
Change this call to a readFile call and create the file if it does not exist beforehand.

Invalid thread name

Changes in TCB message format causes the thread name to be invalid:
image
This occurs in "FROM_MSG" fetch mode.

Wrong manga name in message

Whenever there is a manga update from TCB, the bot will try to identify which manga it is based on the message.
If there is an entry for the manga One Piece and if it set to a regex like One(.?)Piece then it causes a problem because updates of all manga titles will be detected as One Piece. See below:
image
The reason this is happening is because the regex match is too permissive for "One Piece" and so it stops at the host name of TCB: "https://onepiecechapters.com/chapters/5593/black-clover-chapter-347"

The way regex match on manga titles should be modified to ignore this case. Maybe instead of looking for a match in the entire match, we should first isolate the URL and use a regex pattern on the right-hand side to only extract the manga title (See #7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.