Skip to content

Instantly share code, notes, and snippets.

@Mackaber
Last active April 1, 2017 20:44
Show Gist options
  • Save Mackaber/fe5a5db4d31275508ffde97b6cc2acae to your computer and use it in GitHub Desktop.
Save Mackaber/fe5a5db4d31275508ffde97b6cc2acae to your computer and use it in GitHub Desktop.
Place a pixel at /r/place automatically
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