Closed purpleslurple closed 11 months ago
https://onedrive.live.com/view.aspx?resid=F4873BF54ECA028%2110983&id=documents&wd=target%28MTOT.one%7C99AFFF12-5685-4B73-9BB3-9B8005C2488A%2FMTOT%20Cardinality%204.75e%2B38%7C57286820-0BCD-4607-87C4-3647FAD96364%2F%29 onenote:https://d.docs.live.net/0f4873bf54eca028/Documents2/MatthewSchneiderDeveloper/MTOT.one#MTOT%20Cardinality%204.75e+38§ion-id={99AFFF12-5685-4B73-9BB3-9B8005C2488A}&page-id={57286820-0BCD-4607-87C4-3647FAD96364}&end
<?php $urls = array( "https://example.com/page1", "https://example.com/page2", // Add more URLs here );
$totalUrls = count($urls); $matchedCount = 0;
foreach ($urls as $url) { // Retrieve the web page content $webContent = file_get_contents($url);
// Extract all words from the content
$words = str_word_count(strip_tags($webContent), 1);
// Select a random starting point for 8 consecutive words
$startIndex = mt_rand(0, count($words) - 8);
// Get the next 8 consecutive words
$randomString = implode(" ", array_slice($words, $startIndex, 8));
// Wrap the random string in quotes
$quotedString = '"' . $randomString . '"';
// Send the query to Google
$googleQuery = "https://www.google.com/search?q=" . urlencode($quotedString);
// Get the URL of the first result from Google
$googleResults = file_get_contents($googleQuery);
preg_match('/<a href="\/url\?q=(.*?)&/', $googleResults, $match);
$googleResultURL = urldecode($match[1]);
// Compare the URLs
$matchCondition = ($googleResultURL === $url) ? "Match" : "No match";
// Print the results
echo "Current URL: $url<br>";
echo "Quoted String: $quotedString<br>";
echo "First Google result: $googleResultURL<br>";
echo "Match condition: $matchCondition<br><br>";
if ($matchCondition === "Match") {
$matchedCount++;
}
}
$matchPercentage = ($matchedCount / $totalUrls) * 100; echo "Percentage matched: $matchPercentage%"; ?>
MTOT Cardinality 4.75e+38