// ==UserScript==
// @name Stack Exchange Flag Tracker
// @namespace https://so.floern.com/
// @version 1.2.1
// @description Tracks flagged posts on Stack Exchange.
// @author Floern
// @contributor double-beep
// @include /^https?:\/\/(?:[^/.]+\.)*(?:stackexchange\.com|stackoverflow\.com|serverfault\.com|superuser\.com|askubuntu\.com|stackapps\.com|mathoverflow\.net)\/(?:q(?:uestions)?)/
// @exclude *://chat.stackoverflow.com/*
// @exclude *://chat.stackexchange.com/*
// @exclude *://chat.*.stackexchange.com/*
// @exclude *://api.*.stackexchange.com/*
// @exclude *://data.stackexchange.com/*
// @connect so.floern.com
// @grant GM_xmlhttpRequest
// @run-at document-end
// @updateURL https://github.com/SOBotics/Userscripts/raw/master/GenericBot/flagtracker.user.js
// @downloadURL https://github.com/SOBotics/Userscripts/raw/master/GenericBot/flagtracker.user.js
// ==/UserScript==
/* globals StackExchange */
(function() {
if (!StackExchange.options.user.isRegistered) return; // user is not logged in
const key = 'Cm45BSrt51FR3ju';
const myProfileElement = document.querySelector('.my-profile .gravatar-wrapper-24');
const flaggername = myProfileElement ? myProfileElement.title : null;
const sitename = window.location.hostname;
const flagTrackerButtonHtml = '
'
+ ' '
+ '
';
function computeContentHash(postContent) {
if (!postContent) return 0;
var hash = 0;
for (var i = 0; i < postContent.length; ++i) {
hash = ((hash