/ Published in: JavaScript
This Greasemonkey script will insert a link to "Report spam on this page" for photo and album pages on www.23hq.com. The current URL will be POSTed to a forum on 23hq.com.
Feel free to add suggestions and improvements in the comments.
Expand |
Embed | Plain Text
// ==UserScript== // @name 23hq.com: Report Spam // @namespace http://www.23hq.com // @description Adds a link to a photo detail page to quickly report spam in comments // @match http://23hq.com/*/photo/* // @match http://www.23hq.com/*/photo/* // @match http://23hq.com/*/album/* // @match http://www.23hq.com/*/album/* // Inspired by Skeeve's script at http://board.jdownloader.org/showthread.php?t=14453 // ==/UserScript== (function() { try { var photosidebar = document.getElementById('addCommentForm'); if (!photosidebar) { return; } var clickListener=function (evt) { var href= evt.target.href; GM_xmlhttpRequest({ method: "POST", //url: "http://www.23hq.com/photogroup/help/conversation/5804228/message-add", url: "http://www.23hq.com/photogroup/help/conversation/6958311/message-add", headers: { "Content-Type": "application/x-www-form-urlencoded", "Accept": "*/*" }, data: "subject=Spam person detected!&content=Spam found on this page: " + encodeURIComponent(document.location), onload: function(response) { // alert("OnLoad: " + response.responseText); } }); evt.stopPropagation(); evt.preventDefault(); } var toolsDiv = document.createElement('div'); toolsDiv.setAttribute("style", "margin-top:16px;text-align:right"); // create our link var reportSpamLink = document.createElement('a'); reportSpamLink.href='#'; // add text to our link var reportSpamLinkText = document.createTextNode('Report spam on this page'); reportSpamLink.appendChild(reportSpamLinkText); reportSpamLink.addEventListener('click', clickListener, true); // add link to our div toolsDiv.appendChild(reportSpamLink); photosidebar.appendChild(toolsDiv); } catch (eErr) { alert ("Greasemonkey error: " + eErr); } return; }) ();
Comments
Subscribe to comments
You need to login to post a comment.

Changed @include to @match