Untitled


SUBMITTED BY: Guest

DATE: Nov. 13, 2013, 10:49 p.m.

FORMAT: Text only

SIZE: 2.6 kB

HITS: 11975

  1. $keyword = stackoverflow;
  2. foreach(array(co,net,org,info,us,ca,biz,me,mobi,tv,ws,asia,cc,la,xxx) as $tld )
  3. if (checkdnsrr($keyword.'.'.$tld, 'A')){
  4. echo 'taken<br>';
  5. }else{
  6. echo 'available<br>';
  7. }
  8. $tlds = array(co,net,org,info,us,ca,biz,me,mobi,tv,ws,asia,cc,la,xxx);
  9. $numberOFtlds = count($tlds);
  10. $tldResults = array();
  11. function doesDomainExists($keyword,$tld){
  12. if (checkdnsrr($keyword.'.'.$tld, 'A')){
  13. //echo 'taken<br>';
  14. $tldResults[$tld] = taken;
  15. }else{
  16. $tldResults[$tld] = available;
  17. }
  18. }
  19. // where the function is to be run asynchronously
  20. $finished = false;
  21. while ( ! $finished ):
  22. $number_of_results = count($tldResults);
  23. if ( $tldResults == $numberOFtlds ):
  24. $finished = true;
  25. endif;
  26. endwhile;
  27. <?
  28. function getSession(){
  29. $now = new DateTime(null, new DateTimeZone('America/New_York'));
  30. $i = $now->format('Y-m-d H:i:s');
  31. return md5($i);
  32. }
  33. function countlines($lookupID){
  34. $lines = file('factory/'.$lookupID.'/results.txt');
  35. return count($lines);
  36. }
  37. function startScript($keyword,$tld){
  38. fopen('factory/$lookupID/'.$tld.'.php?keyword='.$keyword.'&tld='.$tld, 'a+');
  39. }
  40. // get keyword
  41. $keyword = 'stackoverflow';
  42. // set array of tlds
  43. $tlds = array(co,net,org,info,us,ca,biz,me,mobi,tv,ws,asia,cc,la,xxx);
  44. // get loop up id
  45. $lookupID = getSession();
  46. // create temporary factory room
  47. mkdir('factory/'.$lookupID, 0777, true);
  48. // fill factory room with scripts
  49. $toolScript = ('<? ignore_user_abort(true); $k = $_GET["keyword"]; $t = $_GET["tld"]; function tofile($content) { file_put_contents("results.txt", $content."n", FILE_APPEND | LOCK_EX); } if (checkdnsrr("$k.$t", "A")){ tofile("$t|taken"); }else{ tofile("$t|available"); } ?>');
  50. foreach($tlds as $tool) file_put_contents('factory/'.$lookupID.'/'.$tool.'.php', $toolScript);
  51. // initiate while server
  52. file_put_contents('factory/'.$lookupID.'/results.txt', '');
  53. $number_of_tlds = count($tlds);
  54. $finished = false;
  55. while (!$finished):
  56. if (countlines($lookupID) == $number_of_tlds):
  57. $finished = true;
  58. echo done;
  59. endif;
  60. endwhile;
  61. // where the function is to be run asynchronously
  62. foreach ($tlds as $tld) {
  63. startScript($keyword,$tld);
  64. }

comments powered by Disqus