add_action('wp_ajax_skidrow_cron_import', 'skidrow_run_import');
add_action('wp_ajax_nopriv_skidrow_cron_import', 'skidrow_run_import');
function skidrow_run_import() {
$feed = simplexml_load_file('https://www.skidrowreloaded.com/feed/');
foreach ($feed->channel->item as $item) {
$link = (string)$item->link;
$title = (string)$item->title;
if (get_page_by_title($title, OBJECT, 'post')) continue;
$html = file_get_contents($link);
if (!$html) continue;
libxml_use_internal_errors(true);
$doc = new DOMDocument();
$doc->loadHTML($html);
$xpath = new DOMXPath($doc);
$entry = $xpath->query("//div[contains(@class,'entry')]")->item(0);
if (!$entry) continue;
$about = $requirements = $screenshots = $gameplay = $info = "";
$inside_about = $inside_req = $inside_info = false;
foreach ($entry->getElementsByTagName("*") as $el) {
$tag = $el->nodeName;
$text = strtolower(trim($el->textContent));
$outer = $doc->saveHTML($el);
if (strpos($text, 'about the game') !== false) {
$inside_about = true;
$inside_req = $inside_info = false;
$about .= $outer;
continue;
}
if (strpos($text, 'minimum:') !== false || strpos($text, 'system requirements') !== false) {
$inside_req = true;
$inside_about = $inside_info = false;
$requirements .= $outer;
continue;
}
if (strpos($text, 'burn or mount') !== false || strpos($text, 'install the game') !== false || strpos($text, '[ccln_php]') !== false) {
$inside_info = true;
$inside_about = $inside_req = false;
$info .= $outer;
continue;
}
if ($tag == "img" && strpos($el->getAttribute("src"), "steam") !== false) {
$screenshots .= $outer;
continue;
}
if ($tag == "iframe" && strpos($el->getAttribute("src"), "youtube.com") !== false) {
$gameplay .= $outer;
continue;
}
if ($inside_about) $about .= $outer;
elseif ($inside_req) $requirements .= $outer;
elseif ($inside_info) $info .= $outer;
}
$content = "";
if (!empty($about)) $content .= "[wptab name='DESCRIPTION / DOWNLOAD']\n" . $about . "\n[/wptab]\n";
if (!empty($requirements)) $content .= "[wptab name='SYSTEM REQUIREMENTS']\n" . $requirements . "\n[/wptab]\n";
if (!empty($screenshots)) $content .= "[wptab name='SCREENSHOTS']\n" . $screenshots . "\n[/wptab]\n";
if (!empty($gameplay)) $content .= "[wptab name='GAMEPLAY']\n" . $gameplay . "\n[/wptab]\n";
if (!empty($info)) $content .= "[wptab name='INFO']\n" . $info . "\n[/wptab]\n";
$content .= "[end_wptabset]";
wp_insert_post([
'post_title' => $title,
'post_content' => $content,
'post_status' => 'publish',
'post_type' => 'post',
'post_category' => [get_cat_ID('PC GAMES')],
'tags_input' => ['Skidrow', 'Reloaded', 'Reloaded and Skidrow']
]);
}
echo "✅ Import via cron uitgevoerd.";
wp_die();
}
PC GAMES – Page 121 – Reloaded & Skidrow Games
Browsing: PC GAMES
BETA – V01.08.2015 – TORRENT SUPERHOT is an FPS game where time moves only when you move. The innovative time control mechanics create…
Read More TiNYiSO – ONE FTP LINK – TORRENT In Absolute Drift, you will master the art of drifting. Practice your skills in…
Read More PLAZA – ONE FTP LINK – TORRENT Take on the role of Victor Locke, a mercenary hired by the church to clean out the filth that…
Read More FTS – V1.19.2.1 – 27 DLCs – TORRENT Travel across Europe as king of the road, a trucker who delivers important cargo across…
Read More SKIDROW – ONE FTP LINK – TORRENT Start by boarding a washed-up space cruiser and fulfill your destiny as an aspiring captain on…
Read More PROPHET – ONE FTP LINK – TORRENT In Super Splatters you’ll be throwing a band of semi-suicidal Splatters across the stage…
Read More CODEX – UPDATE V1.01 – TORRENT Dream is an exploration game that takes place within the subconscious mind of Howard Phillips…
Read More CODEX – ONE FTP LINK – TORRENT ENKI is a repeatable horror experience about escape. With multiple endings and an extensive…
Read More V0.21C – ONE FTP LINK – TORRENT As the lone survivor of a passenger jet crash, you find yourself in a mysterious forest battling…
Read More