mrvivacious / PorNo-_Porn_Blocker

Porn blocker that redirects users from porn to positive, fulfilling websites
http://pornblockeris.me/
Other
162 stars 30 forks source link

[Metric] Redirection count #79

Open mrvivacious opened 3 years ago

mrvivacious commented 3 years ago

Is your feature request related to a problem? Please describe. Problem...well, sometimes I wonder if PorNo! is actually helpful or useful. Current ideas for answering that question, add a donate option (if someone donates, then that means one person sees value in this project) and add a counter for how many times people are redirected. smth like 43,210 porn sites have been redirected from, that otherwise would have been accessed by people like you and me.

Describe the solution you'd like I guess, a PorNo! website that displays the redirect information, and until then, a Firestore data point that I can view LOL. Already made an issue for donations #78

Describe alternatives you've considered User surveys would be a good next step to get personal info from each user and their lifestyles with PorNo!.

Additional context n/a

Summary

As a human being that works on PorNo! I want feedback loop of validation So that working on PorNo! feels meaningful and worthwhile

Work description

Exit criteria

Redirection on chrEx increments firestore. same with android app

Feature is released in ChrEx / Android update

mrvivacious commented 3 years ago

Some notes, chrome extension implementation:

// On redirect event aka PorNo()
// https://stackoverflow.com/questions/4673527
let currentTimeInMillis = new Date().getTime();

// Update personal redirect data
let redirectsFromStorage = chrome.storage.sync.get(...);
redirectsFromStorage.push(currentTimeInMillis);
chrome.storage.sync.set(redirectsFromStorage...);

// Update placeholder for diffs between personal data and items added to DB
let prevDBValue = chrome.storage.sync.get(...);
let diff = redirectsFromStorage.length - prevDBValue;
prevDBValue = redirectsFromStorage.length;
chrome.storage.sync.set(prevDBValue...);
updateGlobalCounterInFirebase(prevDBValue);

//.... POPUP / UI code ....
// User opens statistics page, render dates:
let redirectsFromStorage = chrome.storage.sync.get(...);

foreach (event : redirectsFromStorage):
  let date = new Date(event); // create Date object
  let dateUI = buildListItem(date);
  addItemToUI(dateUI);
mrvivacious commented 3 years ago

Started storing redirect events as a list of millsecond timestamps

mrvivacious commented 3 years ago

Commit, ChrEx syncs with Firestore

For now, syncing as timestamps. If there is too much data in a month and we don't end up finding any useful things to do with the global redirection data represented as timestamps, we will move to storing an int instead