Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spam / Security #75

Open
shiffman opened this issue Feb 7, 2018 · 2 comments
Open

Spam / Security #75

shiffman opened this issue Feb 7, 2018 · 2 comments

Comments

@shiffman
Copy link
Member

shiffman commented Feb 7, 2018

The gallery was flooded with spam and inappropriate messages. I have removed the worst content and am now attempting to write some code to bulk remove the repeated sketches.

If anyone can offer any help or ideas, please chime in here.

@shiffman
Copy link
Member Author

shiffman commented Feb 7, 2018

Thanks to the always wonderful @meiamsome, they have now been removed. For future reference here is the code snippet which can run in the consol (only works if you are logged in as admin):

let start = 'KEY_FOR_OLDEST_BAD_SKETCH';
firebase.database().ref('gallery').orderByKey().startAt(start).once('value').then((query) => {
  query.forEach((sketch) => console.log(sketch.key, firebase.database().ref('gallery/' + sketch.key).remove()));
})

Note endAt() can also be used. Unfortunately we lost one legitimate sketch but I backed it up first so am re-adding it.

I will leave this issue open, we may want to consider adding some protections to the site (same IP can't submit sketches over and over?)

@jeremydouglass
Copy link

Difference checking might catch a lot of near-duplicates, especially sketches that are identical to a previous sketch but with an altered text string. "I changed a single string" seems easy to detect. So: in addition to duplicate detection, something like Levenshtein distance, or Baysian spam filtering, or fuzzy hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants