[Facebook] The Questions trap – get the questions YOU want

So I’ve been playing around with one of those recent Facebook features. That’s called “Did You Know?” aka Fun Facts.

I kept tapping on “New Question” most of the time because I wasn’t sure what to do with the most. You really need to think more than twice before posting anything on social media these days. Some questions like “A flaw of mine…” are too dangerous to answer unless you’re being sarcastic or posting some smart answer. Also, I my gut feeling tells me that Facebook may use some of the intelligence gathered through fun facts for targeted advertising and marketing. Who wants to be a target, eh?

So I kept tapping on New Question until I see something comfortable. But sigh! My fingers are too used to this tapping and they’re faster than my reading. Whenever I see a question where I’ve got a fun answer, I pass it by mistake before even I read it completely. There’s no Back button to get it back, other than tapping the “New Question” button. It’s behavior appears to be random, but that randomness is likely to waste 10 – 15 minutes of your time.

So I set a little trap to catch the interesting questions. What it does is simple. It keeps tapping “New Question” until it sees the one you want. Once finished it will alert you. In the meantime you can switch to a different browser tab and spend your time on something productive.

So here it is… all you have to do is, once you’re at the “Did You Know” pop up in Facebook pull up the browser console [firefox|chrome] and run this piece of JavaScript code. Make sure to replace the regular expression with your search query [try/learn regex].

// Find the New Question button
var b = document.getElementsByTagName("button");
var b1 = undefined;
for (var i=0; i<b.length; i++) {
  if (b[i].innerText == "New Question") {
    b1 = b[i];
    break;
  }
}
b1.click();
function newQ () {
  // Find the question section's text
  var t = document.querySelectorAll('[data-testid="profile_fun_facts_dialog"]')[0].innerText;
  // Replace text between slashes with a regular expression
  // Use https://regex101.com/ to easily compose one
  // In this example it will search for just one word, "relax"
  if (t.toLowerCase().match (/relax/)) {
    alert ("Eureka!");
    found();
  } else {
    // Interval between taps is 1 second
    t = setTimeout ( newQ, 1000 );
    b1.click ();
  }
}

var t = undefined;
// Interval between taps is 1 second
t = setTimeout ( newQ, 1000 );

function found () {
    clearTimeout (t);
}

Now, switch to another tab and spend your valuable time on something productive until you take your next “Facebook-break”.

Facebook will warn you with a big “STOP” sign when you open the script console, but this one is totally safe as anyone can read this simple piece of code. Facebook warns because some scammers also exploit the browser feature.

Facebook doesn’t like you to automate some of it’s features, so over the time this script may not work, but right now… it really works. 🙂

[Facebook] The Questions trap – get the questions YOU want

Leave a comment