Processing-Hour-Of-Code icon indicating copy to clipboard operation
Processing-Hour-Of-Code copied to clipboard

Spam / Security

Open shiffman opened this issue 7 years ago • 2 comments

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 avatar Feb 07 '18 17:02 shiffman

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?)

shiffman avatar Feb 07 '18 17:02 shiffman

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.

jeremydouglass avatar Feb 07 '18 17:02 jeremydouglass