save_lookup($lookup); } } // -- variables -- $names = file("names.txt"); // ---- define constants ----------- $g_acegi_cookie = "c3JpX3NhdXJhYmgyMDAwQHlhaG9vLmNvbToxMzUxNDkwNzg3NzA2OjI3ZTExMzRhYjNiZDMyNzAzZmExNTM0NWZlZDk0NjFj"; $g_session_cookie = "1419A95DE327C6A7CBDF86475665DA09.s3"; $g_debug = true; // --- run ------ foreach ($names as $name) { if (empty($name)) { continue; } $name = trim($name); // deserialize the lookup $lookup = load_lookup(); $pageNo = 1; if (array_key_exists($name, $lookup)) { $pageNo = $lookup[$name]; //already processed if (intval($pageNo) == -1) { continue; } } run_on_name($name, $pageNo, $lookup); printf("processing over for - %s \n", $name); $lookup[$name] = -1; save_lookup($lookup); sleep(1); }
// 1-100 seo // 1-100 sales // 1-400 marketing // air hostess 1-100 // fashion 1-100 // designer 1-100 // secretary 1-100 // front office 1-100 // export 1-300 // hotel management $tokens = array("manager" => 1, "zeenat" => 1); // ---- define constants ----------- $g_acegi_cookie = "c3JpX3NhdXJhYmgyMDAwQHlhaG9vLmNvbToxMzUyMjk2MjYxOTY4OmNjN2IxNjZkNTFlOThlOTg4YjJkNTkwNDFkZTE3ZDFh"; $g_session_cookie = "580B7BE80DF49A6F7444B7C8230F7D77.s2"; $g_debug = false; //delay in seconds $g_delay = 4; // --- run ------ $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20100101 Firefox/10.0.7 Iceweasel/10.0.7"); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //actual search page results - what you see on UI foreach ($tokens as $name => $pageNo) { printf("process name %s \n", $name); run_on_name($ch, $name, $pageNo); printf("processed name %s \n", $name); } //free resources curl_close($ch);
{ // Recommended version, using strpos return strpos($haystack, $needle) === 0; } // -- variables -- $lines = file("surnames.txt"); // ---- define constants ----------- $g_acegi_cookie = "c3JpX3NhdXJhYmgyMDAwQHlhaG9vLmNvbToxMzUyNDQzNTM2NjI0OmViMDM1MjY5YzhmZWE2M2NiNjlmYmM4NzI5NTNiMTky"; $g_session_cookie = "4C846FF7EC78A966C88CC4ADFB3C4438.s3"; $g_debug = false; $g_delay = 3; // pass $store = false; foreach ($lines as $line) { if (empty($line)) { continue; } $line = trim($line); if (starts_with($line, '#')) { //toggle store flag! $store = $store ? false : true; } if ($store) { if (starts_with($line, '#')) { continue; } //process this line printf("processing : %s \n", $line); run_on_name($line, 1); } }