Saviour of Lost Souls: also applicable to Software Recommendations
This commit is contained in:
parent
969e3740df
commit
0ef08eea8f
|
@ -5,11 +5,13 @@
|
||||||
// @author Glorfindel
|
// @author Glorfindel
|
||||||
// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
|
// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
|
||||||
// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
|
// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
|
||||||
// @version 0.3
|
// @version 0.4
|
||||||
// @match *://meta.stackexchange.com/questions/*
|
// @match *://meta.stackexchange.com/questions/*
|
||||||
// @match *://meta.stackoverflow.com/questions/*
|
// @match *://meta.stackoverflow.com/questions/*
|
||||||
|
// @match *://softwarerecs.stackexchange.com/questions/*
|
||||||
// @exclude *://meta.stackexchange.com/questions/ask
|
// @exclude *://meta.stackexchange.com/questions/ask
|
||||||
// @exclude *://meta.stackoverflow.com/questions/ask
|
// @exclude *://meta.stackoverflow.com/questions/ask
|
||||||
|
// @exclude *://softwarerecs.stackexchange.com/questions/ask
|
||||||
// @grant none
|
// @grant none
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
@ -75,11 +77,15 @@
|
||||||
if (!nonOwnerComment) {
|
if (!nonOwnerComment) {
|
||||||
// Post comment
|
// Post comment
|
||||||
let author = owner.find('div.user-details a')[0].innerText;
|
let author = owner.find('div.user-details a')[0].innerText;
|
||||||
let comment = "Hi " + author + ", welcome to Meta! " +
|
|
||||||
"I'm not sure which search brought you here but the problem you describe will not be answered on this specific site. " +
|
let comment = window.location.host === "softwarerecs.stackexchange.com"
|
||||||
"To get an answer from users that have the expertise about the topic of your question you'll have to find and then re-post on the [proper site](https://stackexchange.com/sites). " +
|
? ("Hi " + author + ", welcome to [softwarerecs.se]! " +
|
||||||
"Check [How do I ask a good question](/help/how-to-ask) and [What is on topic](/help/on-topic) on the *target* site to make sure your post is in good shape. " +
|
"This question does not appear to be about software recommendations, within [the scope defined on meta](https://softwarerecs.meta.stackexchange.com/questions/tagged/scope) and in the [help center](/help/on-topic).")
|
||||||
"Your question is definitely off-topic on [Meta](/help/whats-meta) and is better deleted here.";
|
: ("Hi " + author + ", welcome to Meta! " +
|
||||||
|
"I'm not sure which search brought you here but the problem you describe will not be answered on this specific site. " +
|
||||||
|
"To get an answer from users that have the expertise about the topic of your question you'll have to find and then re-post on the [proper site](https://stackexchange.com/sites). " +
|
||||||
|
"Check [How do I ask a good question](/help/how-to-ask) and [What is on topic](/help/on-topic) on the *target* site to make sure your post is in good shape. " +
|
||||||
|
"Your question is definitely off-topic on [Meta](/help/whats-meta) and is better deleted here.");
|
||||||
$.post({
|
$.post({
|
||||||
url: "https://" + document.location.host + "/posts/" + postID + "/comments",
|
url: "https://" + document.location.host + "/posts/" + postID + "/comments",
|
||||||
data: "fkey=" + fkey + "&comment=" + encodeURI(comment),
|
data: "fkey=" + fkey + "&comment=" + encodeURI(comment),
|
||||||
|
@ -128,7 +134,7 @@
|
||||||
// Flag/vote to close (doesn't matter for the API call)
|
// Flag/vote to close (doesn't matter for the API call)
|
||||||
$.post({
|
$.post({
|
||||||
url: "https://" + document.location.host + "/flags/questions/" + postID + "/close/add",
|
url: "https://" + document.location.host + "/flags/questions/" + postID + "/close/add",
|
||||||
data: "fkey=" + fkey + "&closeReasonId=OffTopic&closeAsOffTopicReasonId=8",
|
data: "fkey=" + fkey + "&closeReasonId=OffTopic&closeAsOffTopicReasonId=" + (window.location.host === "softwarerecs.stackexchange.com" ? "5" : "8"),
|
||||||
success: function () {
|
success: function () {
|
||||||
// TODO: update close vote count
|
// TODO: update close vote count
|
||||||
console.log("Close flag/vote cast.");
|
console.log("Close flag/vote cast.");
|
||||||
|
|
Loading…
Reference in New Issue