A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[Completed] Giving away account worth 150mil in value.

18k views · started by Tree · · closed · page 4 of 6
#121
working on things,
i dont think i'll be done in time

guessing 752
#122
Tree has code scattered about the forums and others have posted open work here before too.

It can't be too difficult to try and scrap something together. Cause I can't see anyone winning via guessing l0l.


A lot of it I deleted from my github recently since I'm reworking it and a lot wasn't ever up to my standards.

@Use, I already said I'll extend it if nobody guesses in time or makes a bot for it.
#123
gr8


Gonna be done in JS.
I was considering making it have reply features in case you got quoted and it would use Cleverbot to figure out replies. (Better than nothing)
But...that got complicated and I got bored. xD
#124
Tree wrote:
A lot of it I deleted from my github recently since I'm reworking it and a lot wasn't ever up to my standards.

@Use, I already said I'll extend it if nobody guesses in time or makes a bot for it.


I know
I thought everyone was waiting until the last second to post their bots
#125
57 8)
#126
764
#127
100
#128
B0O8 wrote:
I wasn't trying to sound like a bitch or anything, just a little paranoid is all. I'm learning python, but it's not as easy as I thought. I don't know how to put the strings of coding together is the problem. I read tutorials, and it's just garbled mess kinda like most of my ranting posts. I posted that this morning when I was "under the influence" sorry if it sounded like bitching, I was merely trying to sort some stuff out with my paranoid mind. Although I am not good at python, I'll take my chances with trying to script before monday, and I'll be posting guesses. Has anyone come close to actually getting the answer right "within 50" if so how many?

:puffpuffpass:

26
#129
B0O8 wrote:
so if you did guess the right number, but at the EXACT same second someone gave you the auto poster you were wishing for with anti-captcha no ban and what-not, who would be the winner. (in theory) I'd personally guess the programmer mainly because it took effort, but I've spent at least 30 minutes going through your posts, and all that to find ANY number that was in between 1-1000 that could be backwards "letter" numbers like abc=123 or bee=255. I'm guessing 666 mainly because it's 3 numbers and its sequenced. How would your system be proven positive or negative. AND if someone guessed the right number (unlikely because I haven't heard you say that someone else knows the number and has proven it...) then someone still gave you the auto-poster, would you reward the auto poster before or would you ignore their program. assuming you're already going to say that you have the number written down, I'd like to say that this seems posh in the idea that 1-1000 could definitely be guessed before Monday if 10 posting every 10 minutes gives you a few more minutes to go along with what you're doing, and still have the right number guessed, then those 10 people could split the profit equally, and this is of course all in theory. What's the probablility that someone would guess the right number within the allotted time? then again you've already said it yourself

Quote:



Option 2 seems easier
With things like these I always get paranoid and think what if I guessed the number and they said its wrong because they dont want me to win?


That's the point, option 2 is easier.



quote end: but I'm probably just rambling since your mind is pretty much made up.


I don't know if Tree objects, but if I may call the ruling on this, if someone makes the program, they have first priority of winning over someone guessing the number. But as the rule says, the program has a deadline, so the guesser winning after the deadline is fair and within the rules of the original post. But if the guesser guesses before the deadline, I'd say the program maker should get it if they finish before the deadline.
#130
117
#131
@gamecheif, preciate that shit, n puff puff pass back to you mah brotha. it sounds legit to me man. I was just iffy about the rules, before i got too dedicated


255
#132
387
#133
Edit: I would never put a bot or any other ToS violating code on this site.:D
#134
XD GRATZ
#135
Spoiler
// ==UserScript==
// @author Awesomolocity
// @description Wins a contest lol
// @name Contest Winner
// @include http://www.gaiaonline.com/forum/*
// @include http://gaiaonline.com/forum/*
// @requre http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// ==/UserScript==
//Used jQuery because I'm lazy, and it looks pretty.
//Lol.

//Should I turn this into a giant class?
//I have like no experience with classes, really. o_O
//I should do that as a side project...
function post(id){
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/compose/quickreply/new/'+ id +'/',
dataType: 'json',
//async: false,
}).done(function(json){
if(json["show_captcha"]===true){
var captcha=window.showModalDialog('data:text/html;base64,PGh0bWw+CjxoZWFkPjwvaGVhZD4KPGJvZHk+CjxzY3JpcHQ+CmRvY3VtZW50LndyaXRlKCJEYW0gQ2FwdGNoYTo8YnIvPiIrd2luZG93LmRpYWxvZ0FyZ3VtZW50cyk7Cjwvc2NyaXB0Pgo8YnIvPgo8aW5wdXQgaWQ9ImNhcHRjaGEiIHR5cGU9InRleHQiLz4KPGlucHV0IGlkPSJzdWJtaXQiIHR5cGU9ImJ1dHRvbiIgdmFsdWU9IlN1Ym1pdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2NhcHRjaGEnKS52YWx1ZTsgd2luZG93LmNsb3NlKCk7Ij48YnIvPgo8aW5wdXQgdHlwZT0iYnV0dG9uIiB2YWx1ZT0iSSBjYW4gbm90IHJlYWQgdGhhdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gJ25ldyc7IHdpbmRvdy5jbG9zZSgpOyI+PGJyLz4KPGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkkgZG8gbm90IGhhdmUgdGltZSBmb3IgdGhpcy4iIG9uY2xpY2s9IndpbmRvdy5yZXR1cm5WYWx1ZSA9ICcnOyB3aW5kb3cuY2xvc2UoKTsiPgo8L2JvZHk+CjwvaHRtbD4=','<img src="'+json['captcha_img']+'"/>',"dialogwidth: 350; dialogheight: 150; resizable: yes");
if(!captcha || captcha.length==0){
var abort=true;
}
else if(captcha=='new'){
var abort=true;
setTimeout('post('+id+')',0);
}
else{
abort=false;
var captchaKey=json["captcha_challenge"];
}
}
else{
var captcha='';
abort=false;
}
if(abort===false){
if(!captchaKey){
captchaKey='';
}
var pc = 1;
if(GM_getValue(id)){
pc = GM_getValue(id)+1;
}
GM_setValue(id, pc);
var post = '[align=center]:ninja:\n'+ pc +'[/align]';//format post a little. Lol.
$.ajax({
method: 'POST',
dataType: 'json',
async: false,
data: 'nonce='+json['nonce']+'&recaptcha_response_field='+escape(captcha)+'&recaptcha_challenge_field='+captchaKey+'&message='+escape(post)+'&action_submit=submit',
url: 'http://www.gaiaonline.com/forum/compose/ajaxentry/new/'+id+'/'
}).done(function(data){
if(data['status']===true){
alert('victory');
}
else{
if(confirm('Failed to complete post. Gaia said:\n\t"'+data['message']+'"\nWould you like to try again?')===true){
setTimeout('post('+id+')',0);
}
}
});
}
});
}
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/mobileapp/forums/show/f.23',
async: false,
dataType: 'html',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
$(r).find('.topic-left a').each(function(){
var $title = $(this).text();
var $id = $(this).attr('href').split('http://www.gaiaonline.com/mobileapp/forums/show/t.')[1]
for(var i = 0; i<keywords.length; i++){
var keyword = keywords[i];
if($title.indexOf(keyword) != -1){
threads.push($id);
}
}
});
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}
function main(){
var thread = forumScanner();
post(thread);
var wait = Math.random() * (10000 - 2500) + 2500;
setTimeout("location.reload(true);",wait);
}
main();[/0][/i][/1]


Tampermonkey users might need to actually add in the jQuery library manually. (jQuery.com for link)
Got lazy on timing.
Still should have better error handling for when you're posting too fast.
Want to add cleverbot conversations, but...got lazy. xP

IS THERE A SPOILER TAG? Lol.
#136
T3h Mule wrote:
Spoiler
// ==UserScript==
// @author Awesomolocity
// @description Wins a contest lol
// @name Contest Winner
// @include http://www.gaiaonline.com/forum/*
// @include http://gaiaonline.com/forum/*
// @requre http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// ==/UserScript==
//Used jQuery because I'm lazy, and it looks pretty.
//Lol.

//Should I turn this into a giant class?
//I have like no experience with classes, really. o_O
//I should do that as a side project...
function post(id){
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/compose/quickreply/new/'+ id +'/',
dataType: 'json',
//async: false,
}).done(function(json){
if(json["show_captcha"]===true){
var captcha=window.showModalDialog('data:text/html;base64,PGh0bWw+CjxoZWFkPjwvaGVhZD4KPGJvZHk+CjxzY3JpcHQ+CmRvY3VtZW50LndyaXRlKCJEYW0gQ2FwdGNoYTo8YnIvPiIrd2luZG93LmRpYWxvZ0FyZ3VtZW50cyk7Cjwvc2NyaXB0Pgo8YnIvPgo8aW5wdXQgaWQ9ImNhcHRjaGEiIHR5cGU9InRleHQiLz4KPGlucHV0IGlkPSJzdWJtaXQiIHR5cGU9ImJ1dHRvbiIgdmFsdWU9IlN1Ym1pdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2NhcHRjaGEnKS52YWx1ZTsgd2luZG93LmNsb3NlKCk7Ij48YnIvPgo8aW5wdXQgdHlwZT0iYnV0dG9uIiB2YWx1ZT0iSSBjYW4gbm90IHJlYWQgdGhhdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gJ25ldyc7IHdpbmRvdy5jbG9zZSgpOyI+PGJyLz4KPGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkkgZG8gbm90IGhhdmUgdGltZSBmb3IgdGhpcy4iIG9uY2xpY2s9IndpbmRvdy5yZXR1cm5WYWx1ZSA9ICcnOyB3aW5kb3cuY2xvc2UoKTsiPgo8L2JvZHk+CjwvaHRtbD4=','<img src="'+json['captcha_img']+'"/>',"dialogwidth: 350; dialogheight: 150; resizable: yes");
if(!captcha || captcha.length==0){
var abort=true;
}
else if(captcha=='new'){
var abort=true;
setTimeout('post('+id+')',0);
}
else{
abort=false;
var captchaKey=json["captcha_challenge"];
}
}
else{
var captcha='';
abort=false;
}
if(abort===false){
if(!captchaKey){
captchaKey='';
}
var pc = 1;
if(GM_getValue(id)){
pc = GM_getValue(id)+1;
}
GM_setValue(id, pc);
var post = '[align=center]:ninja:\n'+ pc +'[/align]';//format post a little. Lol.
$.ajax({
method: 'POST',
dataType: 'json',
async: false,
data: 'nonce='+json['nonce']+'&recaptcha_response_field='+escape(captcha)+'&recaptcha_challenge_field='+captchaKey+'&message='+escape(post)+'&action_submit=submit',
url: 'http://www.gaiaonline.com/forum/compose/ajaxentry/new/'+id+'/'
}).done(function(data){
if(data['status']===true){
alert('victory');
}
else{
if(confirm('Failed to complete post. Gaia said:\n\t"'+data['message']+'"\nWould you like to try again?')===true){
setTimeout('post('+id+')',0);
}
}
});
}
});
}
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/mobileapp/forums/show/f.23',
async: false,
dataType: 'html',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
$(r).find('.topic-left a').each(function(){
var $title = $(this).text();
var $id = $(this).attr('href').split('http://www.gaiaonline.com/mobileapp/forums/show/t.')[1]
for(var i = 0; i<keywords.length; i++){
var keyword = keywords[i];
if($title.indexOf(keyword) != -1){
threads.push($id);
}
}
});
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}
function main(){
var thread = forumScanner();
post(thread);
var wait = Math.random() * (10000 - 2500) + 2500;
setTimeout("location.reload(true);",wait);
}
main();[/0][/i][/1]


Tampermonkey users might need to actually add in the jQuery library manually. (jQuery.com for link)
Got lazy on timing.
Still should have better error handling for when you're posting too fast.
Want to add cleverbot conversations, but...got lazy. xP

IS THERE A SPOILER TAG? Lol.


Why did you make an alternate account to post this?

Good job either way. Looks fairly functional. Congrats if you won.
#137
Storminq wrote:
XD GRATZ


Thanks. xP
Needs a ton of improvements, but not a bad starting point.
#138
Why did you make an alternate account to post this?

Good job either way. Looks fairly functional. Congrats if you won.


Because I don't feel comfortable posting anything that violates Gaia ToS. xD
To be honest, the only reason I want to win this contest is because I'm curious what the account is. xP Don't really care about the items or gold.
#139
T3h Mule wrote:
Because I don't feel comfortable posting anything that violates Gaia ToS. xD
To be honest, the only reason I want to win this contest is because I'm curious what the account is. xP Don't really care about the items or gold.


Unless someone else posts some source, then in about 4 1/2 hours it looks like you will win.
A few points though. I believe from my testing with quick reply is it will only want a captcha if you aren't verified, otherwise it has never asked me for it (not 100% sure I could be wrong). There is also a much better way to getting forum topics through a JSON return, which would make getting thread IDs incredibly simple.
Other than that it looks fine, and you'll most likely win it now.

Edit: Since you actually posted source, I'm going to close down the guessing of numbers now. It's strictly a source code contest.
#140
Tree wrote:
Unless someone else posts some source, then in about 4 1/2 hours it looks like you will win.
A few points though. I believe from my testing with quick reply is it will only want a captcha if you aren't verified, otherwise it has never asked me for it (not 100% sure I could be wrong). There is also a much better way to getting forum topics through a JSON return, which would make getting thread IDs incredibly simple.
Other than that it looks fine, and you'll most likely win it now.

Edit: Since you actually posted source, I'm going to close down the guessing of numbers now. It's strictly a source code contest.


I've gotten captchas on quick reply before. It's kinda rare, but it happens.
I actually didn't think about doing it the way you mentioned (though I may have found it; I'll ask if what I thought you meant was right after the contest ends). BUT the mobile API generates (a very small amount, but...real nonetheless) gold when you use it. Using the code I posted would not only get gold from posting, but it would also get gold from the mobile API.
Also, still working on the bot. Making tweaks here and there, just in case someone else submits something.

Edit: Did this because lol. :-p
Spoiler
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/pulse?id=23&ts='+ new Date().getTime(),
async: false,
dataType: 'json',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
for(var x in r){
var title = r[x].topic;
var id = r[x].url.split('t.')[1];
for(var i = 0; i<keywords.length;i++){
var keyword = keywords[i];
if(title.indexOf(keyword) != -1){
threads.push(id);
}
}
}
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}[/0][/i][/1][/x][/x]
#141
Is anyone else going to post anything, or do we have a winner 8D
#142
T3h Mule wrote:
I've gotten captchas on quick reply before. It's kinda rare, but it happens.
I actually didn't think about doing it the way you mentioned (though I may have found it; I'll ask if what I thought you meant was right after the contest ends). BUT the mobile API generates (a very small amount, but...real nonetheless) gold when you use it. Using the code I posted would not only get gold from posting, but it would also get gold from the mobile API.
Also, still working on the bot. Making tweaks here and there, just in case someone else submits something.

Edit: Did this because lol. :-p
Spoiler
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/pulse?id=23&ts='+ new Date().getTime(),
async: false,
dataType: 'json',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
for(var x in r){
var title = r[x].topic;
var id = r[x].url.split('t.')[1];
for(var i = 0; i<keywords.length;i++){
var keyword = keywords[i];
if(title.indexOf(keyword) != -1){
threads.push(id);
}
}
}
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}[/0][/i][/1][/x][/x]


There should be a way to automatically parse returns such as Forum Pulse, especially in what you are using. I know in Python I was able to read Forum Pulse to a dictionary using simplejson (the default JSON module only works on well formed JSON).

Edit: jQuery.parseJSON/
#143
Tree wrote:
There should be a way to automatically parse returns such as Forum Pulse, especially in what you are using. I know in Python I was able to read Forum Pulse to a dictionary using simplejson (the default JSON module only works on well formed JSON).

Edit: jQuery.parseJSON/


o_O Pretty sure $.ajax() will automatically parse the json. xD Hence why on the response, I go straight into for(var x in r). o.o
#144
T3h Mule wrote:
o_O Pretty sure $.ajax() will automatically parse the json. xD Hence why on the response, I go straight into for(var x in r). o.o


Oh, I just glanced over it quickly, and saw the split so was thinking you were splitting the return. Misread it + I barely use Javascript.
It still looks like you will win unless Use or someone else posts something.
#145
111 ftw
#146
Tree wrote:
Oh, I just glanced over it quickly, and saw the split so was thinking you were splitting the return. Misread it + I barely use Java.
It still looks like you will win unless Use or someone else posts something.


It's all good. I barely use python. :-p
#147
Tree wrote:
Misread it + I barely use Java.


Dude, JavaScript.

I know you of all people know the difference and probably rushed this post. But come on, that mistake is just careless.
#148
Dude, JavaScript.

I know you of all people know the difference and probably rushed this post. But come on, that mistake is just careless.


Coulda swore I typed Javascript. Either way, that's what I meant editing now.
#149
1 1/2 hour until the deadline to submit and code is hit.
#150
Dude, JavaScript.


Common, easy mistake. I generally overlook it.
#151
T3h Mule wrote:
Common, easy mistake. I generally overlook it.


Rookie mistake from a decent to good programmer like Tree. He's too experienced for mistakes like that.

From generally anyone else who has at least a smidgen of skill it's acceptable.
#152
Tree wrote:
1 1/2 hour until the deadline to submit and code is hit.


dang I thought alaska time was later than my time :O
anyways

looking forward to seeing more programs
#153
Final code...for now.
Spoiler
// ==UserScript==
// @author T3h Mule
// @description Wins a contest lol
// @name Contest Winner
// @version 0.1.0
// @include http://www.gaiaonline.com/forum/*
// @include http://gaiaonline.com/forum/*
// @requre http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// ==/UserScript==
//Used jQuery because I'm lazy, and it looks pretty.
//Lol.

//Should I turn this into a giant class?
//I have like no experience with classes, really. o_O
//I should do that as a side project...
function post(id){
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/compose/quickreply/new/'+ id +'/',
dataType: 'json',
//async: false,
}).done(function(json){
if(json["show_captcha"]===true){
var captcha=window.showModalDialog('data:text/html;base64,PGh0bWw+CjxoZWFkPjwvaGVhZD4KPGJvZHk+CjxzY3JpcHQ+CmRvY3VtZW50LndyaXRlKCJEYW0gQ2FwdGNoYTo8YnIvPiIrd2luZG93LmRpYWxvZ0FyZ3VtZW50cyk7Cjwvc2NyaXB0Pgo8YnIvPgo8aW5wdXQgaWQ9ImNhcHRjaGEiIHR5cGU9InRleHQiLz4KPGlucHV0IGlkPSJzdWJtaXQiIHR5cGU9ImJ1dHRvbiIgdmFsdWU9IlN1Ym1pdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2NhcHRjaGEnKS52YWx1ZTsgd2luZG93LmNsb3NlKCk7Ij48YnIvPgo8aW5wdXQgdHlwZT0iYnV0dG9uIiB2YWx1ZT0iSSBjYW4gbm90IHJlYWQgdGhhdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gJ25ldyc7IHdpbmRvdy5jbG9zZSgpOyI+PGJyLz4KPGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkkgZG8gbm90IGhhdmUgdGltZSBmb3IgdGhpcy4iIG9uY2xpY2s9IndpbmRvdy5yZXR1cm5WYWx1ZSA9ICcnOyB3aW5kb3cuY2xvc2UoKTsiPgo8L2JvZHk+CjwvaHRtbD4=','<img src="'+json['captcha_img']+'"/>',"dialogwidth: 350; dialogheight: 150; resizable: yes");
if(!captcha || captcha.length==0){
var abort=true;
}
else if(captcha=='new'){
var abort=true;
setTimeout('post('+id+')',0);
}
else{
abort=false;
var captchaKey=json["captcha_challenge"];
}
}
else{
var captcha='';
abort=false;
}
if(abort===false){
if(!captchaKey){
captchaKey='';
}
var pc = 1;
if(GM_getValue(id)){
pc = GM_getValue(id)+1;
}
GM_setValue(id, pc);
var post = '[align=center]:ninja:\n'+ pc +'[/align]';//format post a little. Lol.
$.ajax({
method: 'POST',
dataType: 'json',
async: false,
data: 'nonce='+json['nonce']+'&recaptcha_response_field='+escape(captcha)+'&recaptcha_challenge_field='+captchaKey+'&message='+escape(post)+'&action_submit=submit',
url: 'http://www.gaiaonline.com/forum/compose/ajaxentry/new/'+id+'/'
}).done(function(data){
if(data['status']===true){
//alert('victory'); Debug. Whoops.
}
else{
if(confirm('Failed to complete post. Gaia said:\n\t"'+data['message']+'"\nWould you like to try again?')===true){
setTimeout('post('+id+')',0);
}
}
});
}
});
}
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/mobileapp/forums/show/f.23',
async: false,
dataType: 'html',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
$(r).find('.topic-left a').each(function(){
var $title = $(this).text();
var $id = $(this).attr('href').split('http://www.gaiaonline.com/mobileapp/forums/show/t.')[1]
for(var i = 0; i<keywords.length; i++){
var keyword = keywords[i];
if($title.indexOf(keyword) != -1){
threads.push($id);
}
}
});
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}
function main(){
var thread = forumScanner();
post(thread);
var wait = Math.random() * (10000 - 2500) + 2500;//Between 2.5 and 10 seconds. Can be modified as you wish. Protip: Change the values a bit, so that everyone isn't posting at the same rate.
setTimeout(main, wait);
}
main();[/0][/i][/1]


Fixed the refresher so that the page doesn't have to reload.
Optional: Use forum pulse instead of mobile API
Spoiler
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/pulse?id=23&ts='+ new Date().getTime(),
async: false,
dataType: 'json',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
for(var x in r){
var title = r[x].topic;
var id = r[x].url.split('t.')[1];
id = id.split('/')[0];
for(var i = 0; i<keywords.length;i++){
var keyword = keywords[i];
if(title.indexOf(keyword) != -1){
threads.push(id);
}
}
}
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}[/0][/i][/0][/1][/x][/x]


Tampermonkey users will need to include jQuery manually into the file. Check jquery.com for the link. Not sure about Firefox users. xD Didn't test in Firefox.
#154
T3h Mule wrote:
Final code...for now.
Spoiler
// ==UserScript==
// @author T3h Mule
// @description Wins a contest lol
// @name Contest Winner
// @version 0.1.0
// @include http://www.gaiaonline.com/forum/*
// @include http://gaiaonline.com/forum/*
// @requre http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// ==/UserScript==
//Used jQuery because I'm lazy, and it looks pretty.
//Lol.

//Should I turn this into a giant class?
//I have like no experience with classes, really. o_O
//I should do that as a side project...
function post(id){
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/compose/quickreply/new/'+ id +'/',
dataType: 'json',
//async: false,
}).done(function(json){
if(json["show_captcha"]===true){
var captcha=window.showModalDialog('data:text/html;base64,PGh0bWw+CjxoZWFkPjwvaGVhZD4KPGJvZHk+CjxzY3JpcHQ+CmRvY3VtZW50LndyaXRlKCJEYW0gQ2FwdGNoYTo8YnIvPiIrd2luZG93LmRpYWxvZ0FyZ3VtZW50cyk7Cjwvc2NyaXB0Pgo8YnIvPgo8aW5wdXQgaWQ9ImNhcHRjaGEiIHR5cGU9InRleHQiLz4KPGlucHV0IGlkPSJzdWJtaXQiIHR5cGU9ImJ1dHRvbiIgdmFsdWU9IlN1Ym1pdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2NhcHRjaGEnKS52YWx1ZTsgd2luZG93LmNsb3NlKCk7Ij48YnIvPgo8aW5wdXQgdHlwZT0iYnV0dG9uIiB2YWx1ZT0iSSBjYW4gbm90IHJlYWQgdGhhdCIgb25jbGljaz0id2luZG93LnJldHVyblZhbHVlID0gJ25ldyc7IHdpbmRvdy5jbG9zZSgpOyI+PGJyLz4KPGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkkgZG8gbm90IGhhdmUgdGltZSBmb3IgdGhpcy4iIG9uY2xpY2s9IndpbmRvdy5yZXR1cm5WYWx1ZSA9ICcnOyB3aW5kb3cuY2xvc2UoKTsiPgo8L2JvZHk+CjwvaHRtbD4=','<img src="'+json['captcha_img']+'"/>',"dialogwidth: 350; dialogheight: 150; resizable: yes");
if(!captcha || captcha.length==0){
var abort=true;
}
else if(captcha=='new'){
var abort=true;
setTimeout('post('+id+')',0);
}
else{
abort=false;
var captchaKey=json["captcha_challenge"];
}
}
else{
var captcha='';
abort=false;
}
if(abort===false){
if(!captchaKey){
captchaKey='';
}
var pc = 1;
if(GM_getValue(id)){
pc = GM_getValue(id)+1;
}
GM_setValue(id, pc);
var post = '[align=center]:ninja:\n'+ pc +'[/align]';//format post a little. Lol.
$.ajax({
method: 'POST',
dataType: 'json',
async: false,
data: 'nonce='+json['nonce']+'&recaptcha_response_field='+escape(captcha)+'&recaptcha_challenge_field='+captchaKey+'&message='+escape(post)+'&action_submit=submit',
url: 'http://www.gaiaonline.com/forum/compose/ajaxentry/new/'+id+'/'
}).done(function(data){
if(data['status']===true){
//alert('victory'); Debug. Whoops.
}
else{
if(confirm('Failed to complete post. Gaia said:\n\t"'+data['message']+'"\nWould you like to try again?')===true){
setTimeout('post('+id+')',0);
}
}
});
}
});
}
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/mobileapp/forums/show/f.23',
async: false,
dataType: 'html',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
$(r).find('.topic-left a').each(function(){
var $title = $(this).text();
var $id = $(this).attr('href').split('http://www.gaiaonline.com/mobileapp/forums/show/t.')[1]
for(var i = 0; i<keywords.length; i++){
var keyword = keywords[i];
if($title.indexOf(keyword) != -1){
threads.push($id);
}
}
});
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}
function main(){
var thread = forumScanner();
post(thread);
var wait = Math.random() * (10000 - 2500) + 2500;//Between 2.5 and 10 seconds. Can be modified as you wish. Protip: Change the values a bit, so that everyone isn't posting at the same rate.
setTimeout(main, wait);
}
main();[/0][/i][/1]


Fixed the refresher so that the page doesn't have to reload.
Optional: Use forum pulse instead of mobile API
Spoiler
function forumScanner(){
var thread;
$.ajax({
type: 'GET',
url: 'http://www.gaiaonline.com/forum/pulse?id=23&ts='+ new Date().getTime(),
async: false,
dataType: 'json',
}).done(function(r){
var keywords = ['give away', 'giveaway', 'givaway', 'give-away', 'giving away'], threads = new Array();
//Array can be extended or condensed. Depends on what you want to do. xP
for(var x in r){
var title = r[x].topic;
var id = r[x].url.split('t.')[1];
id = id.split('/')[0];
for(var i = 0; i<keywords.length;i++){
var keyword = keywords[i];
if(title.indexOf(keyword) != -1){
threads.push(id);
}
}
}
if(threads.length > 0){
thread = threads[0];
}
else{
thread = 36828231;//Use as default in case no giveaways are found. Feel free to change.
}
});
return thread;
}[/0][/i][/0][/1][/x][/x]


Tampermonkey users will need to include jQuery manually into the file. Check jquery.com for the link. Not sure about Firefox users. xD Didn't test in Firefox.


Pretty sure you won. Only two minutes left.
#155
Tree wrote:
Pretty sure you won. Only two minutes left.


Will you be doing more events like this?
#156
Storminq wrote:
Will you be doing more events like this?


Maybe, if I get more accounts when I'm not so busy/lazy.
#157
Tree wrote:
Pretty sure you won. Only two minutes left.


I don't like giving out crappy code. :c
#158
Tree wrote:
Maybe, if I get more accounts when I'm not so busy/lazy.


yessssssss 8)
#159
T3h Mule wrote:
I don't like giving out crappy code. :c


You won anyways since you actually submitted something. About to message you the account info.

For those curious, here's how I'd do it in Python (without any of the selection process, just the two functions)
First function uses forum pulse to get all the thread IDs through a generator, then you just use the post with session (it's copy pasted from a program I made so session would be a requests session) thread id, and the message.


import requests
import simplejson as json

def get_threads(forum_id):
uri = 'http://www.gaiaonline.com/forum/pulse?id={}'.format(forum_id)
for thread_info in json.loads(requests.get(uri).content):
yield thread_info['tid']

def post(session, tid, message):
uri = 'http://www.gaiaonline.com/forum/compose/{}/new/{}'
thread_info = session.get(uri.format('quickreply', tid)).json()
post_data = {
'nonce': thread_info['nonce'],
'message': message,
'action_submit': 'submit',
}
session.post(uri.format('ajaxentry', tid), data=post_data).json()
#160
should this thread be moved now?