I tweaked the code /u/GrandMasterSpaceBat from the giveaway by /u/bobhappypants so all the credit goes to him.
The code allows to check if your number has been taken.
The code can be executed by pressing ctrl + shift + J and paste the following code and change the number to the one you want to check where it says: "var num = ".
also if anyone knows how the /u/GrandMasterSpaceBat and /u/Psetmaj boxed their code in the giveaway by /u/bobhappypants, please tell me how. I haven't started using Reddit much until recently
/********************************************************/ var num = REPLACE THIS WITH YOUR NUMBER; /********************************************************/
//explanation here: http://stackoverflow.com/a/2901298
var numString = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
console.log(numString);
$.getJSON(https://api.pushshift.io/reddit/search/comment?q=${num}&subreddit=Overwatch
, function(data) {
$.each(data.data, function(i, item) {
if (item.parent_id == 't3_4k4hvo') {
console.log(item.body_html);
console.log(new Date(item.created_utc).toString());
console.log('https://www.reddit.com/r/Overwatch/comments/4k4hvo/overmvp_giving_away_2_copies_of_overwatch_origins/' + item.id);
}
});
});
if (num.toString().length > 3) {
$.getJSON(https://api.pushshift.io/reddit/search/comment?q=${numString}&subreddit=Overwatch
, function(data) {
$.each(data.data, function(i, item) {
if (item.parent_id == 't3_4k4hvo') {
console.log(item.body_html);
console.log(new Date(item.created_utc).toString());
console.log('https://www.reddit.com/r/Overwatch/comments/4k4hvo/overmvp_giving_away_2_copies_of_overwatch_origins/' + item.id);
}
});
});
}