jeffalo / my-ocular

backend for ocular
https://ocular.jeffalo.net/docs/about#what-iswas-my-ocular
9 stars 10 forks source link

Add a filter to the statuses #21

Closed LankyBox01 closed 3 years ago

LankyBox01 commented 3 years ago

Please import the anti-profanity plug-in to the dashboard in order for this to work.

https://github.com/CodeGuy92/anti-profanity#readme Docs are here ^^^

FunctionalMetatable commented 3 years ago

Please PR for issues that are marked "help wanted".

LankyBox01 commented 3 years ago

Please PR for issues that are marked "help wanted".

I didn't know that, tho

jeffalo commented 3 years ago

@FunctionalMetatable is right. i dont think this works anyways, filterWords is not defined.

LankyBox01 commented 3 years ago

you have to import it first

LankyBox01 commented 3 years ago

did you read the docs

FunctionalMetatable commented 3 years ago

There is a number of flaws in the suggested solution:

  1. The code itself contains swear words. If jeffalo was to implement this, it is possible for the ST to ban linking to this repository.
  2. String.replaceAll cannot function in Node.js. The only way around this is to use RegExp. (There are many instances of replaceAll in this code.)
  3. Node.js cannot import scripts from a URL.
  4. The keyword var is repeated tons of times
  5. window is undefined in Node.js
  6. If ran in a client-side environment, it writes to the window object itself, which is kinda bad

Take the above as constructive criticism.

cobaltt7 commented 3 years ago
  1. The code itself contains swear words. If jeffalo was to implement this, it is possible for the ST to ban linking to this repository.

yes, you would have to rot13 or otherwise encode the swears, then decode them in the code.

  1. String.replaceAll cannot function in Node.js. The only way around this is to use RegExp. (There are many instances of replaceAll in this code.)

not entirely true. you just need a version of node that supports it, and seeing as replaceAll is pretty new...yeah use replace

  1. Node.js cannot import scripts from a URL.

you can npm install from git if there is a package.json