Last active
December 31, 2016 19:47
-
-
Save connyay/5a579690425c6ab0872eb97c40a13f6c to your computer and use it in GitHub Desktop.
/u/ProudMod Bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(messageNum) { | |
var messages = { | |
1: ["Warning Subject", "Yo! Knock it off.\n\nYou are not respecting the rules."], | |
2: ["Last Chance Subject", "This is your last chance!\n\nPlease review [the rules](https://www.reddit.com/r/ProudMod/wiki)"] | |
} | |
if (/reddit\.com\/user\/*/.test(location.href)) { | |
if (!messageNum) { | |
messageNum = prompt("Which message would you like to compose?"); | |
} | |
var message = messages[messageNum]; | |
if (!message) { | |
return alert("Message not found"); | |
} | |
var user = location.href.split('/').pop(); | |
var subject = message[0]; | |
var body = message[1]; | |
location.href = "https://www.reddit.com/message/compose/?to=" + user + '&subject=' + encodeURIComponent(subject) + '&message=' + encodeURIComponent(body); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(a){var b={1:["Warning Subject","Yo! Knock it off.\n\nYou are not respecting the rules."],2:["Last Chance Subject","This is your last chance!\n\nPlease review [the rules](https://www.reddit.com/r/ProudMod/wiki)"]};if(/reddit\.com\/user\/*/.test(location.href)){a||(a=prompt("Which message would you like to compose?"));var c=b[a];if(!c)return alert("Message not found");var d=location.href.split("/").pop(),e=c[0],f=c[1];location.href="https://www.reddit.com/message/compose/?to="+d+"&subject="+encodeURIComponent(e)+"&message="+encodeURIComponent(f)}}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(a){var b={1:["Warning Subject","Yo! Knock it off.\n\nYou are not respecting the rules."],2:["Last Chance Subject","This is your last chance!\n\nPlease review [the rules](https://www.reddit.com/r/ProudMod/wiki)"]};if(/reddit\.com\/user\/*/.test(location.href)){a||(a=prompt("Which message would you like to compose?"));var c=b[a];if(!c)return alert("Message not found");var d=location.href.split("/").pop(),e=c[0],f=c[1];location.href="https://www.reddit.com/message/compose/?to="+d+"&subject="+encodeURIComponent(e)+"&message="+encodeURIComponent(f)}}(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(a){var b={1:["Warning Subject","Yo! Knock it off.\n\nYou are not respecting the rules."],2:["Last Chance Subject","This is your last chance!\n\nPlease review [the rules](https://www.reddit.com/r/ProudMod/wiki)"]};if(/reddit\.com\/user\/*/.test(location.href)){a||(a=prompt("Which message would you like to compose?"));var c=b[a];if(!c)return alert("Message not found");var d=location.href.split("/").pop(),e=c[0],f=c[1];location.href="https://www.reddit.com/message/compose/?to="+d+"&subject="+encodeURIComponent(e)+"&message="+encodeURIComponent(f)}}(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment