Skip to content

Instantly share code, notes, and snippets.

@divinity76
Last active August 22, 2018 08:48
Show Gist options
  • Select an option

  • Save divinity76/ab5998d4ee552ca3fb40dd83c69f1afc to your computer and use it in GitHub Desktop.

Select an option

Save divinity76/ab5998d4ee552ca3fb40dd83c69f1afc to your computer and use it in GitHub Desktop.
<?php
error_reporting ( E_ALL );
function hhb_tohtml($str) {
return htmlentities ( $str, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE | ENT_DISALLOWED, 'UTF-8', true );
}
$ch = curl_init ();
$fh = tmpfile ();
$f = stream_get_meta_data ( $fh );
$f = $f ['uri'];
// var_dump($f);die("shit");
if (! $fh) {
die ( "fag" );
}
if (isset ( $_GET ['q'] )) {
$q = ( string ) $_GET ['q'];
$url = 'http://xhamster.com/search.php?from=&q=' . rawurlencode ( $q ) . '&qcat=video';
} else {
$q = '';
$url = 'http://xhamster.com/';
}
if (! file_exists ( "cookies.jar.txt" )) {
file_put_contents ( "cookies.jar.txt", '#' );
}
if (! curl_setopt_array ( $ch, array (
CURLOPT_AUTOREFERER => true,
CURLOPT_BINARYTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTPGET => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_CONNECTTIMEOUT => 4,
CURLOPT_TIMEOUT => 8,
CURLOPT_ENCODING => '', // << makes curl post all supported encodings, gzip/deflate/etc, makes transfers faster
CURLOPT_USERAGENT => 'curl',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
CURLOPT_VERBOSE => true,
CURLOPT_STDERR => $fh,
CURLOPT_COOKIEFILE => 'cookies.jar.txt',
CURLOPT_COOKIEJAR => 'cookies.jar.txt',
CURLOPT_FORBID_REUSE => true,
CURLOPT_MAXCONNECTS => 1,
CURLOPT_HTTPHEADER => array (
'Connection: Close'
)
) )) {
throw new Exception ( "negro" );
}
$html = curl_exec ( $ch );
if (! is_string ( $html )) {
echo "SOME CURL ERROR. curl_errno: " . curl_errno ( $ch ) . ". curl_error: " . curl_error ( $ch ) . ".\n\n";
$html = file_get_contents ( 'cached.passwords.html' );
} else {
$html .= '<query>' . hhb_tohtml ( $q ) . '</query>';
file_put_contents ( 'cached.passwords.html', $html );
}
curl_close ( $ch );
$interesting = array ();
// var_dump(
// $interesting,
// $html,
// file_get_contents($f)
// );
// echo $html;die();
$domd = @DOMDocument::loadHTML ( $html );
$xp = new DOMXPath ( $domd );
$words = [ ];
foreach ( $xp->query ( '//a[contains(@class,"video-thumb-info")]' ) as $res ) {
$words = array_merge ( $words, preg_split ( "/\s+/", $res->textContent ) );
}
$words = array_iunique ( $words );
//die ( "dieds" );
function array_iunique($array) {
return array_intersect_key ( $array, array_unique ( array_map ( "StrToLower", $array ) ) );
}
if (0) {
foreach ( $domd->getElementsByTagName ( "*" ) as $ele ) {
if ($ele->getAttribute ( "class" ) !== "video") {
continue;
}
$text = $ele->getElementsByTagName ( "img" )->item ( 0 )->getAttribute ( "alt" );
$text = trim ( $text );
foreach ( explode ( " ", $text ) as $word ) {
$interesting [] = mb_strtolower ( trim ( $word ), 'UTF-8' );
}
}
}
$interesting = $words;
header ( "content-type: text/plain;charset=utf8" );
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
echo "your password is: " . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . ucfirst ( $interesting [array_rand ( $interesting, 1 )] ) . "\n";
$query = $domd->getElementsByTagName ( "query" )->item ( 0 )->textContent;
if ($query) {
echo "the query used was: " . $query;
} else {
echo "no query was used.";
}
echo str_repeat ( "\n", 10 ) . "curl stderr: \n" . file_get_contents ( $f );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment