Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted (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 by sniko
Posted
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.

Posted
<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>

?

Posted
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

Posted

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>
Posted

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.

Posted
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.

Posted
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.

Posted

@rockwood

if(array_key_exists('id', $_POST)) i think if(isset($_POST['id'])) is better bcz is much faster
Proof?

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
Posted
@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

Posted
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?
Posted
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.

  • 2 weeks later...
  • 2 months later...
Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...