chicka Posted August 23, 2013 Posted August 23, 2013 i've done a lot of research and can't seem to find what i'm looking for. Hopefully someone here has one or can create one for me. I need a bot to use on my own personal site i'm working on. what I need it to do is something like this: http://mysite.com/user.php?id=12345 http://mysite.com/user.php?id=12344 http://mysite.com/user.php?id=12343 and so on. So instead of typing all that in the browser one at a time I just enter 12345 and it automatically goes down or up 1 number at a time.. Not sure if I explained that correctly lol. any help would be appreciated. Thanks Quote
sniko Posted August 23, 2013 Posted August 23, 2013 (edited) Something like; <a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br /> <?php if(array_key_exists('id', $_POST)) { $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs( (int) $_POST['id']) : 0; $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs( (int) $_POST['goup']) : 10; $goup = $goup > 50 ? 50 : $goup; echo '<ul>'; if($_POST['direction'] == 'up') { //Count upwards for($i=0;$i<=$goup;$i++) { $param = $id + $i; echo '<li>mysite.com/user.php?id='. $param .'</li>'; } } else { //Count downwards for($i=0;$i<=$goup;$i--) { $param = $id + $i; echo '<li>mysite.com/user.php?id='. $param .'</li>'; if($param < ($id - $goup)) { break; } } } echo '</ul>'; } ?> <form action="" method="post"> Starting ID: <input type="text" name="id" /> <br /> Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 50) <br /> Direction: <select name="direction"> <option value="up" selected>Up</option> <option value="down">Down</option> </select> <br /> <input type="submit" value="Perform Execution" /> </form> The math can be done much more efficiently, however. Edited August 23, 2013 by sniko Quote
chicka Posted August 23, 2013 Author Posted August 23, 2013 Thanks sniko. Not quite what I was looking for tho. I tested it and can't seem to get it to work.. Quote
sniko Posted August 23, 2013 Posted August 23, 2013 Thanks sniko. Not quite what I was looking for tho. I tested it and can't seem to get it to work.. What exactly was it you're looking for? I've got some spare time, so I'll give it another shot. Quote
Joel Posted August 23, 2013 Posted August 23, 2013 <script type="text/javascript"> var id = window.location.search.split("id=")[1]; var url = "http://example.com/user.php?id="; setTimeout(function(){ id--; window.location.replace(url + id); },1000); </script> ? Quote
rockwood Posted August 23, 2013 Posted August 23, 2013 Something like; <a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br /> <?php if(array_key_exists('id', $_POST)) { $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs( (int) $_POST['id']) : 0; $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs( (int) $_POST['goup']) : 10; $goup = $goup > 50 ? 50 : $goup; echo '<ul>'; if($_POST['direction'] == 'up') { //Count upwards for($i=0;$i<=$goup;$i++) { $param = $id + $i; echo '<li>mysite.com/user.php?id='. $param .'</li>'; } } else { //Count downwards for($i=0;$i<=$goup;$i--) { $param = $id + $i; echo '<li>mysite.com/user.php?id='. $param .'</li>'; if($param < ($id - $goup)) { break; } } } echo '</ul>'; } ?> <form action="" method="post"> Starting ID: <input type="text" name="id" /> <br /> Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 50) <br /> Direction: <select name="direction"> <option value="up" selected>Up</option> <option value="down">Down</option> </select> <br /> <input type="submit" value="Perform Execution" /> </form> The math can be done much more efficiently, however. if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much faster Quote
sniko Posted August 23, 2013 Posted August 23, 2013 After the PM with chicka, I've come up with the following; <a href="http://makewebgames.io/showthread.php/43913-Need-a-bot">This was built for Chicka</a> <br /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <?php if (array_key_exists('id', $_POST)) { $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) ? abs((int) $_POST['id']) : 0; $goup = filter_input(INPUT_POST, 'goup', FILTER_VALIDATE_INT) ? abs((int) $_POST['goup']) : 10; $goup = $goup > 15 ? 15 : $goup; ?> <script> var dataArray = []; function storeIt(data) { dataArray.push(data); console.log('Data is stored in the array'); console.log(dataArray.length); } dataArray.sort(); setTimeout(function() { if (dataArray.length >= <?php echo $goup - 1; ?>) { $.each(dataArray, function(idx, val) { $("#profile").delay(1000).queue(function(next) { $(this).empty().html(val); next(); }); }); } }, 1000); </script> <?php if ($_POST['direction'] == 'up') { //Count upwards for ($i = 0; $i <= $goup; $i++) { $param = $id + $i; ?> <script> $.get('profile.php?id=' + <?php echo $param; ?>, storeIt); </script> <?php } } else { //Count downwards for ($i = 0; $i <= $goup; $i--) { $param = $id + $i; ?> <script> $.get('profile.php?id=' + <?php echo $param; ?>, storeIt); </script> <?php if ($param < ($id - $goup)) { break; } } } } ?> <div id="profile"></div> <form action="" method="post"> Starting ID: <input type="text" name="id" /> <br /> Increment/Decrement by: <input type="text" name="goup" /> (Default is 10. No higher than 15) <br /> Direction: <select name="direction"> <option value="up" selected>Up</option> <option value="down">Down</option> </select> <br /> <input type="submit" value="Perform Execution" /> </form> Quote
Alan Posted August 23, 2013 Posted August 23, 2013 Command line suffices surely... for i in {12345..12360}; do curl -o user-$i.html http://mysite.com/user.php?id=$i; done Change start.end & options to suit. Quote
sniko Posted August 23, 2013 Posted August 23, 2013 Command line suffices surely...for i in {12345..12360}; do curl -o user-$i.html http://mysite.com/user.php?id=$i; done Change start.end & options to suit. You must spread some Reputation around before giving it to Alan again. Quote
SRB Posted August 23, 2013 Posted August 23, 2013 if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much faster If clues were cookies... you would be hungry. Quote
chicka Posted August 23, 2013 Author Posted August 23, 2013 Thank you Sniko for your time and effort. Truly appreciated :D Quote
sniko Posted August 23, 2013 Posted August 23, 2013 Thank you Sniko for your time and effort. Truly appreciated :D Quote
Alan Posted August 24, 2013 Posted August 24, 2013 @rockwood if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much fasterProof? In any case, array_key_exists() is considered the correct solution since isset() fails on certain values: [[email protected] ~]$ cat test.php <?php $array = array( 'a' => false, 'b' => 0, 'c' => null ); echo "isset() ...\n"; echo ' ' . (isset($array['a']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['b']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['c']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['d']) ? 'true ' : 'false') . "\n"; echo "\nvs array_key_exists() ...\n"; echo ' ' . (array_key_exists('a', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('b', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('c', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('d', $array) ? 'true ' : 'false') . "\n"; which when run produces: [[email protected] ~]$ php -f test.php isset() ... true true false <-- isset() fails to spot null values false vs array_key_exists() ... true true true false Quote
rockwood Posted August 25, 2013 Posted August 25, 2013 @rockwoodProof? In any case, array_key_exists() is considered the correct solution since isset() fails on certain values: [[email protected] ~]$ cat test.php <?php $array = array( 'a' => false, 'b' => 0, 'c' => null ); echo "isset() ...\n"; echo ' ' . (isset($array['a']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['b']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['c']) ? 'true ' : 'false') . "\n"; echo ' ' . (isset($array['d']) ? 'true ' : 'false') . "\n"; echo "\nvs array_key_exists() ...\n"; echo ' ' . (array_key_exists('a', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('b', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('c', $array) ? 'true ' : 'false') . "\n"; echo ' ' . (array_key_exists('d', $array) ? 'true ' : 'false') . "\n"; which when run produces: [[email protected] ~]$ php -f test.php isset() ... true true false <-- isset() fails to spot null values false vs array_key_exists() ... true true true false which example you given that is also right . my point :- isset() i was mean that this is only checking this that this is existing variable or not. array_key_exists() in this case first, if that would not be array then it would create the problem. nothing else Quote
Alan Posted August 25, 2013 Posted August 25, 2013 which example you given that is also right . my point :- isset() i was mean that this is only checking this that this is existing variable or not. array_key_exists() in this case first, if that would not be array then it would create the problem. And in English? Quote
chicka Posted August 25, 2013 Author Posted August 25, 2013 Why do you want a bot anyway? Hard to explain. The point was to be able to sit back and not have to click 1 profile at a time. For example I start with id 1 (which is me) then it automatically goes to id 2 then 3 and so on. Wasn't trying to do anything illegal. its on my own site i'm working on. Quote
topmorpg Posted September 8, 2013 Posted September 8, 2013 I can build a software that will allow this for you with a built in browser and its own container for cookies. send me an email [email protected] or skype: emw-dgn Quote
Lucifer.iix Posted November 19, 2013 Posted November 19, 2013 i've done a lot of research and can't seem to find what i'm looking for. Hopefully someone here has one or can create one for me. I need a bot to use on my own personal site i'm working on. what I need it to do is something like this: http://mysite.com/user.php?id=12345 http://mysite.com/user.php?id=12344 http://mysite.com/user.php?id=12343 and so on. So instead of typing all that in the browser one at a time I just enter 12345 and it automatically goes down or up 1 number at a time.. Not sure if I explained that correctly lol. any help would be appreciated. Thanks Maybe a strange question, but why do you want to have this, if it's already your own site ? http://mysite.com/users.php?startid=1&endid=12345 http://mysite.com/users.php?startid=12345&endid=1 Happy Hacking: Roger Quote
a_bertrand Posted November 19, 2013 Posted November 19, 2013 Lucifer: could you stop to wake up old threads? Threads older than 1 month are usually useless to wake up. Quote
Lucifer.iix Posted November 19, 2013 Posted November 19, 2013 @ sorry, bertrand didn't saw it. I just was browing the list and respondig. I will look at it next time. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.