loadHTML($str . " "); // ker "source must not be empty" alneki foreach ($dom->getElementsByTagName("a") as $a) $r[] = $a->getAttribute("href"); return $r; } function query_sijanec () { return extract_ahrefs(get_string_between(file_get_contents("http://splet.sijanec.eu"), "", "")); $r = []; foreach (explode("\n", explode("", explode("", file_get_contents("http://splet.sijanec.eu."))[1])[0]) as $line) { if (str_contains("href", $line)) $r[] = explode(">", explode("=", $line)[1])[0]; } return $r; } function query_ass () { return extract_ahrefs(get_string_between(file_get_contents("http://ass.si."), "Meni priljubljeni so internavti:", "")); /* $r = []; foreach (explode("
  • ", explode("", explode("Meni priljubljeni so internavti:", file_get_contents("http://ass.si."))[1])[0]) as $line) { if (str_contains("href", $line)) $r[] = explode('"', explode('"', $line)[1])[0]; } return $r; */ } function query_aikenahac () { return extract_ahrefs(get_string_between(file_get_contents("https://aikenahac.com"), "Friends on the net", "")); $r = []; foreach (explode('", explode("Friends on the net", file_get_contents("https://aikenahac.com"))[1])[0]) as $line) { if (str_contains("href", $line)) $r[] = explode('"', explode('="', $line)[1])[0]; } return $r; } function query_babnik () { return extract_ahrefs(get_string_between(file_get_contents("https://babnik.io"), "Shoutouts", "")); $r = []; foreach (explode("", explode("Shoutouts", file_get_contents("https://babnik.io"))[1])[0]) as $line) { if (str_contains("href", $line)) $r[] = explode('"', explode('="', $line)[1])[0]; } } function query_fortuna () { return extract_ahrefs(get_string_between(file_get_contents("https://fortuna.wf"), "Kul ljudje z medmre", "")); $r = []; foreach (explode("", explode("Kul ljudje z medmre", file_get_contents("https://fortuna.wf/"))[1])[0]) as $line) { if (str_contains("href", $line)) $r[] = explode('"', explode('="', $line)[1])[0]; } return $r; } function query_jakakovac () { $r = []; $dom = new DOMDocument(); $dom->loadHTML(file_get_contents("https://www.jakakovac.si/")); foreach ($dom->getElementById('people')->getElementsByTagName("a") as $a) $r[] = $a->getAttribute("href"); return $r; } function query_lukaverc () { return []; } function query_martin () { return []; } function query_nejckrasevec () { return []; } function query_oliwerix () { return []; } function query_robinhud () { return []; } function query_rstular () { return []; } function query_severkar () { return []; } function query_skret () { return extract_ahrefs(explode("", explode("kulske ljudi na", file_get_contents("https://skret.net"))[1])[0]); } function query_srcnik () { return extract_ahrefs(get_string_between(file_get_contents("http://srcnik.si."), "Prijatelji v mre", "")); // return extract_ahrefs(explode("", explode("Prijatelji v mre", file_get_contents("http://srcnik.si."))[0])); } function query_trussevich () { return []; } function query_vujic () { return []; } function query_ziga () { $a = get_string_between(file_get_contents("https://ziga.kralj.io"), "Znanci z medmr", ""); $b = get_string_between(file_get_contents("https://ziga.kralj.io"), "Interweb associates", ""); if ($a == "") return extract_ahrefs($b); return extract_ahrefs($a); } function query_studen () { return extract_ahrefs(get_string_between(file_get_contents("https://studen.me"), "Frens", "")); } function query_gapi () { return extract_ahrefs(get_string_between(file_get_contents("https://gapi.me"), "Cool People Network", "")); } function query_govekar () { return extract_ahrefs(get_string_between(file_get_contents("https://govekar.net"), "Zanimivi ljudje", "")); } function query_golobii () { return []; } function query_svenahac () { return []; } function query_timhrovat () { return []; } function query_perchperkins () { return []; } function query_asavkovic () { return extract_ahrefs(get_string_between(file_get_contents("https://www.asavkovic.xyz"), "Prijatelji z omre", "")); } function query_jkob () { return []; } function query_azugicjehart () { return []; } function query_cernetic () { return extract_ahrefs(get_string_between(file_get_contents("https://cernetic.cc"), "Friends on the web", "")); } function query_thesuperlab () { return []; } function query_vovk () { return extract_ahrefs(get_string_between(file_get_contents("https://vovk.netlify.app"), "Cool People Network", "")); } function query_lea () { return []; } function query_hyperborea () { return []; } function query_kajtebri () { return []; } function query_sushy () { return []; } function query_lovro () { return []; } function query_bertoncelj () { return []; } function query_timthuma () { return []; } function query_blazdular () { return []; } function query_quartzy () { return []; } function query_markilovar () { return extract_ahrefs(get_string_between(file_get_contents("https://markilovar.com"), "Cool People", "")); } function query_cadez () { return extract_ahrefs(get_string_between(file_get_contents("https://cadez.eu"), "Friends on the web", "")); } function query_janez () { return []; } function query_majmohar () { return []; } function query_gribanica () { return []; } function query_dodoworks () { return []; } function query_skvarca () { return []; } function query_jonpecar () { return []; } function query_matija () { return []; } function query_testman () { return []; } function query_muhvic () { return extract_ahrefs(get_string_between(file_get_contents("https://muhvic.com"), '
    ', "
    ")); } function query_oprin () { return []; // website mu ni delal 2024-06-09 } function query_crushedcookienut () { return extract_ahrefs(get_string_between(file_get_contents("https://crushedcookienut.github.io"), "LJUDJE, KI JIH POZNAM", "")); } function query_laurabavcon () { return extract_ahrefs(get_string_between(file_get_contents("https://laurabavcon.eu"), "LJUDJE, KI JIH POZNAM", "")); } function query_hugotrebse () { return []; } function query_lmao () { return extract_ahrefs(get_string_between(file_get_contents("http://lmao.si"), "prijetelji in ostale strani", "")); } function get_graph () { $queue = ["sijanec"]; $completed = []; $edges = []; $not_implemented = []; $errors = []; while (sizeof($queue) > 0) { $queue_copy = $queue; foreach ($queue_copy as $website) { $added = 0; $completed[] = $website; $queue = array_diff($queue, [$website]); foreach (("query_" . $website)() as $url) { $normed = normalize($url); if (function_exists("query_" . $normed)) { if (!in_array($normed, $completed)) $queue[] = $normed; if (!in_array([$website, $normed], $edges)) $edges[] = [$website, $normed]; $added++; } else $not_implemented[$normed] = [$url, $website]; } if ($added == 0) $errors[] = $website; } } return ["completed" => $completed, "edges" => $edges, "not_implemented" => $not_implemented, "errors" => $errors]; } function edges_to_dot ($edges) { $r = "digraph D {\ngraph [overlap=false splines=true];\n"; foreach ($edges as $edge) $r .= "\t" . $edge[0] . " -> " . $edge[1] . ";\n"; $r .= "}\n"; return $r; } header("Content-Type: text/plain"); if (!empty($_REQUEST['src'])) { die(file_get_contents($_SERVER["SCRIPT_FILENAME"])); } $graph = get_graph(); echo "NAPAKE: \n"; var_dump($graph["errors"]); echo "NOT IMPL:\n"; var_dump($graph["not_implemented"]); file_put_contents("generacija.dot", edges_to_dot($graph["edges"])); $gen = "dot"; foreach (["png", "pdf", "svg"] as $tip) echo `$gen -T$tip -o generacija.$tip generacija.dot 2>&1`; echo "REGENERIRANO!";