Skip to content

Instantly share code, notes, and snippets.

@benbalter
Created March 21, 2012 20:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benbalter/2152739 to your computer and use it in GitHub Desktop.
Save benbalter/2152739 to your computer and use it in GitHub Desktop.
Random URL generator for Siege URL files
<PRE>
<?php
/**
* Generates list of random URLs for use with Siege
* Usefull for getting around caching and whatnot
*/
//path to a wp-load file
include( 'trunk/wp-load.php' );
//pass domain, num, and q via get vars
// domain = domain to benchmark
// num = number of random urls to generate
// q = whether to pass random string as query arg or as path
$domain = ( isset( $_GET['domain'] ) ) ? $_GET['domain'] : '';
$num = ( isset( $_GET['num'] ) ) ? (int) $_GET['num'] : 1000;
$q = ( isset( $_GET['noq'] ) ) ? '' : '?';
$domain = trailingslashit( $domain );
for( $i=0; $i < $num; $i++ )
echo $domain . $q . wp_generate_password( 25, false ) . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment