Last active
April 1, 2017 20:44
-
-
Save Mackaber/fe5a5db4d31275508ffde97b6cc2acae to your computer and use it in GitHub Desktop.
Place a pixel at /r/place automatically
This file contains hidden or 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 postPixel(timeout) { | |
setTimeout(function() { | |
$.getJSON('https://www.reddit.com/api/me.json', function(response){ | |
var modhash = response.data.modhash; | |
$.ajax({ | |
url: "https://www.reddit.com/api/place/draw.json", | |
type: 'post', | |
data: { | |
x: 634, | |
y: 354, | |
color: 0 | |
}, | |
headers: { | |
"X-Modhash": modhash, | |
}, | |
dataType: 'json', | |
success: function (res) { | |
var wait_time = res.wait_seconds * 1000 | |
postPixel(wait_time); | |
} | |
}); | |
}); | |
},timeout); | |
} | |
postPixel(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment