{"id":765,"date":"2017-01-31T23:54:29","date_gmt":"2017-02-01T07:54:29","guid":{"rendered":"http:\/\/www.tranzoa.net\/~alex\/blog\/?p=765"},"modified":"2017-01-31T23:54:29","modified_gmt":"2017-02-01T07:54:29","slug":"make-facebook-pleasant-again","status":"publish","type":"post","link":"https:\/\/www.tranzoa.net\/~alex\/blog\/?p=765","title":{"rendered":"Make Facebook pleasant again"},"content":{"rendered":"<p>I go to Facebook every few days, weeks or whatever. Kids&#8217; pics. Volleyball happenings. Doings of people I&#8217;ve known over the years.<\/p>\n<p>What&#8217;s happened to my follow-feed, though, is people I know to be fine people in real life appear in the feed as the girl on the left:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.tranzoa.net\/alex\/blog\/images\/ranting_girl_school_deseg.jpg\" alt=\"Tantrum Time\" \/><\/p>\n<p>This is disheartening at best.<\/p>\n<p>Politics is entertaining, but, golly, let&#8217;s not scream at our favorite character on TV when they do something dumb. Get a grip.<\/p>\n<p>But, of course, the other guy will never get a grip.<\/p>\n<p>So, for Firefox, there&#8217;s <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/greasemonkey\/\" target=\"_blank\">Grease Monkey<\/a> and my quick and dirty Grease Monkey script, <a href=\"http:\/\/www.tranzoa.net\/alex\/public_stuff\/FaceBookFix.user.js\" target=\"_blank\">FaceBookFix.user.js<\/a>, to the rescue.<\/p>\n<p>This script simply takes Facebook posts off screen if they contain, in text form (sadly not in images), any of a list of words.<\/p>\n<p>It&#8217;s not heavily tested, to say the least. Which is to say, I tried it a couple times.<\/p>\n<p>I made it easy to add or delete banned words. Non-programmers can change the script if they can find it on their disk and save it as a text file from WordPad or a better text editor.<\/p>\n<p>The results are nice. My feed is now pleasant. Again. &#8220;Never do yourself what a computer can do for you,&#8221; so the computer now lets me see the real news un-flooded by noise. (If this post makes it to Facebook, I can&#8217;t write &#8220;f*** news&#8221; or the script will make the post invisible to me!)<\/p>\n<p>Oh. Here&#8217;s the whole script as of this moment:<\/p>\n<p><code style=' white-space: nowrap;'><\/p>\n<pre>\r\n\/\/ ==UserScript==\r\n\/\/ @name        FaceBookFix\r\n\/\/ @namespace   https:\/\/www.tranzoa.net\/~alex\r\n\/\/ @description Get rid of sad Facebook tantrums.    https:\/\/www.tranzoa.net\/alex\/public_stuff\/FaceBookFix.user.js\r\n\/\/ @include     https:\/\/www.facebook.com\/\r\n\/\/ @version     1\r\n\/\/ @grant       none\r\n\/\/ ==\/UserScript==\r\n\r\n\/***\r\n\r\n    FaceBook posts containing any of these listed strings are whacked.\r\n\r\n    The strings are in in no particular order.\r\n\r\n    Change as you see fit.\r\n\r\n    Non-programmers, leave the last one as the last one.\r\n\r\n    Non-programers, for syntax reasons, do not put any:\r\n        single-quote         ( ' )\r\n        pipe\/vertical_stroke ( | )\r\n        backslash            ( \\ )\r\n    characters in any of the strings.\r\n\r\n***\/\r\nvar find_these_strings  = [\r\n    'killary',\r\n    'drumpf',\r\n    'obozo',\r\n    'shillary',\r\n    'repuglican',\r\n    'democrap',\r\n    'libtard',\r\n    'faux news',\r\n    'hilliary',         \/\/ I forget other Internet commenters' alternate spellings. More to come, for sure.\r\n    'trump',\r\n    'hillary',\r\n    'clinton',\r\n    'HRC',\r\n    'DJT',\r\n    'obama',\r\n    'biden',\r\n    'pence',\r\n    'nixon',\r\n    'watergate',\r\n    'reagan',\r\n    'steve bannon',\r\n    'stevebannon',\r\n    'bernie sanders',\r\n    'berniesanders',\r\n    'bernie',           \/\/ Sorry about this, Bernie-from-Dimas-days. Your brand has been trashed.\r\n    'sanders',\r\n    'george bush',      \/\/ 'bush' is just too generic\r\n    'georgebush',\r\n    ' g bush',\r\n    ' gbush',\r\n    ' gw bush',\r\n    ' gwbush',\r\n    ' h bush',\r\n    ' hbush',\r\n    ' hw bush',         \/\/ did I get these bushes right?\r\n    ' hwbush',\r\n    'kkk',              \/\/ why are Hollywood and the news guys obsessed with the KKK? No one in the real world cares about them.\r\n    'mcconnell',        \/\/ maybe this should be only mitch McConnell\r\n    'sean spicer',\r\n    'seanspicer',\r\n    'harry reid',\r\n    'harryreid',\r\n    'paul ryan',\r\n    'paulryan',\r\n    'muslim',\r\n    'impeach',\r\n    'senate',\r\n    'house of rep',\r\n    'parliment',\r\n    'merkel',\r\n    'abortion',\r\n    'pro-life',\r\n    'prolife',\r\n    'pro-choice',\r\n    'prochoice',\r\n    'occupy democrats',\r\n    'occupy wall',\r\n    'fake news',\r\n    'iran',\r\n    'iraq',\r\n    'isreal',\r\n    'saudia arabia',\r\n    'potus',\r\n    'scotus',\r\n    'executive order',\r\n    'daily show',       \/\/ ? poeple seem to feel this show is really important when it discusses politics\r\n    'fuck',             \/\/ the whole profanity list should be here.\r\n    'shit',\r\n    'Note: Leave this here at the end of the list.'\r\n    ];\r\nfind_these_strings  = find_these_strings.join('|').toLowerCase().split('|');\r\nfind_these_strings.pop();       \/\/ get rid of the comment at the end\r\n\r\n\r\n(function (){\r\n\r\nfunction    fix_this_facebook_thing()\r\n{\r\n    var divs = document.getElementsByTagName(\"div\");                            \/\/  Find all DIV elements in the page\r\n    \/\/ window.console.log(\"fixing \" + Date.now() + \" \" + divs.length);\r\n    for (var el_number in divs)                                                 \/\/  Python is *so* superior to JavaScript\r\n    {\r\n        var el  = divs[el_number];\r\n        if ((el.id != undefined) && el.id.startsWith('hyperfeed_story_id_'))    \/\/  For each post in the feed\r\n        {\r\n            var htm = el.innerHTML.toLowerCase();                               \/\/  Look for any of the strings without regard to case\r\n            \/\/ window.console.log(\"scanning \" + el.id + \" \" + htm.length);\r\n            for (string_number in find_these_strings)\r\n            {\r\n                var fs  = find_these_strings[string_number];                    \/\/      For each of the strings to find\r\n                if  (htm.indexOf(fs) >= 0)                                      \/\/          Is the string in the post in text form? (sadly missing them in images and videos)\r\n                {\r\n                    el.style.display    = 'none';                               \/\/          Yes. Take the post off screen\r\n                    \/\/ window.console.log(\"whacked: \" + fs + \" in \" + el.id);\r\n                    break;                                                      \/\/          And don't keep looking in the this post for more matches.\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\r\nvar timeout_every_couple_seconds = window.setInterval(fix_this_facebook_thing, 2017);\r\n\r\n\r\n}());\r\n\r\n\r\n\/\/ eof\r\n<\/pre>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I go to Facebook every few days, weeks or whatever. Kids&#8217; pics. Volleyball happenings. Doings of people I&#8217;ve known over the years. What&#8217;s happened to my follow-feed, though, is people I know to be fine people in real life appear &hellip; <a href=\"https:\/\/www.tranzoa.net\/~alex\/blog\/?p=765\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,11,9,5,12,16],"tags":[],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","category-bloggy-things","category-humor","category-opinion","category-programing","category-programming","category-tips"],"_links":{"self":[{"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=765"}],"version-history":[{"count":10,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":775,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions\/775"}],"wp:attachment":[{"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tranzoa.net\/~alex\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}