webdev03 / scratch-spam

Scratch spam detection
MIT License
1 stars 3 forks source link

Known spammers #11

Open hello-smile6 opened 2 years ago

hello-smile6 commented 2 years ago
webdev03 commented 2 years ago

RTL is included.

hello-smile6 commented 2 years ago

RTL is included.

Huh. Is LTR? Also, could you add a start script to package.json?

webdev03 commented 2 years ago

LTR is too. I don't think the start script is necessary. I'm trying to set up building for releases.

hello-smile6 commented 2 years ago

LTR is too. I don't think the start script is necessary. I'm trying to set up building for releases.

Use pkg and add support for entering the password and username from a prompt if the environment variable isn't set.

webdev03 commented 2 years ago

I'm setting up building now.

webdev03 commented 2 years ago

Actually, nevermind. It's too hard!

hello-smile6 commented 2 years ago

Actually, nevermind. It's too hard!

I'll do it

webdev03 commented 2 years ago

I got building to work, but it can't import the disallow.json on my machine...

hello-smile6 commented 2 years ago

I got building to work, but it can't import the disallow.json on my machine...

Strange. Maybe require() it? Also, binaries will include OpenSSL in the binary, which is pretty big, for HTTPS support.

webdev03 commented 2 years ago

Require wouldn't let us change it

hello-smile6 commented 2 years ago

Require wouldn't let us change it

Huh

hello-smile6 commented 2 years ago
hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$ pkg --compress Brotli -t node16-x64 index.js
> pkg@5.5.2
compression:  Brotli

hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$ pkg --compress Brotli -t node16-win-x64 index.js
> pkg@5.5.2
compression:  Brotli

hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$ ls
auth.js        index.exe*  LICENSE        package.json    README.md
disallow.json  index.js    node_modules/  pnpm-lock.yaml

hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$ index.exe
bash: index.exe: command not found

hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$ ./index.exe
Scratch Spam v0.1.2
What user would you like to check for spam? 9pfs
Found 28 comment thread starters!
Would you like to go to the next page? (Y/n) y
Found 56 comment thread starters!
Would you like to go to the next page? (Y/n) y
Found 72 comment thread starters!
Would you like to go to the next page? (Y/n) y
No more comments able to be found.
Starting checking...
0 bad comment(s) found!
Exiting program...

hello-smile6@localhost MINGW64 ~/Documents/scratch-spam (main)
$
webdev03 commented 2 years ago

Wow

hello-smile6 commented 2 years ago

Wow

We just need a way for people to sign in. Also, could you please make it read users' messages and delete from there? Profiles aren't the only places spammers hit.

hello-smile6 commented 2 years ago

@webdev03 Error:

node:internal/process/task_queues:96
    runMicrotasks();
    ^

Error: Failed to log in with 9pfs,{my password}
    at ScratchSession.init (C:\snapshot\scratch-spam\auth.js)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\snapshot\scratch-spam\index.js
webdev03 commented 2 years ago

If it's someone else's project/profile you can't do anything. I might add project support in the future :)

Edit: Advertisement protection could be there too.

hello-smile6 commented 2 years ago

If it's someone else's project/profile you can't do anything. I might add project support in the future :)

Just read the messages! Just send a request to api.scratch.mit.edu/users/${username}/messages with the user's session ID and CSRF token.

hello-smile6 commented 2 years ago

If it's someone else's project/profile you can't do anything. I might add project support in the future :)

Edit: Advertisement protection could be there too.

Good idea. Then we could have a user-maintained version of filter.scratch.mit.edu that we actually have control over, and that we could add entries to a lot faster than the admins could. We could even make a browser extension that lets people report comments to be added to the blacklist, for cases when something is spam but they don't want to tell the site admins.

webdev03 commented 2 years ago

I know. But studio replies are very rare and have a limit now. Projects could be supported too. I'd also like it so that you don't need to log in to an account to use Scratch Spam, so that you can verify it works.

hello-smile6 commented 2 years ago

I know. But studio replies are very rare and have a limit now. Projects could be supported too. I'd also like it so that you don't need to log in to an account to use Scratch Spam, so that you can verify it works.

Good idea. Also, use the --compression Brotli flag on pkg, so binaries are smaller.

webdev03 commented 2 years ago

But it doesn't work

hello-smile6 commented 2 years ago

But it doesn't work Try this.

npx pkg --compress Brotli -t node16 index.js
chmod u+x `find ./index.*`
chmod u-x ./index.js

Then, execute the index binary.

webdev03 commented 2 years ago

OK, now I need to take the Ninetails builder and edit it.

hello-smile6 commented 2 years ago

OK, now I need to take the Ninetails builder and edit it.

Won't work. That uses electron. Use pkg. Do npm i -g pkg and try it.

webdev03 commented 2 years ago

I made it.

hello-smile6 commented 2 years ago

I made it.

Oh. Could you just use pkg? People might want to build their own binary without installing anything.

webdev03 commented 2 years ago

This is getting a bit offtopic.

A denylist for users I'll add tomorrow. You can "block" people by combining it with a cron job (or just a script on replit)