10
<div style="background: #003046; font-family: Roboto; color: #fff; padding: 20px;">
<CENTER>
<?php
function get_string_between($string, $start, $end){
$string = ' ' . $string;
$ini = strpos($string, $start);
if ($ini == 0) return '';
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}

$page = $_GET['page'];
if(empty($page)){
$url = "https://kwejk.pl/";
} else {
$url = "https://kwejk.pl/strona/$page";
}
$source = file_get_contents($url);

preg_match_all('~<div class=\"figure-holder\">\s*(<div.*?</div>\s*)?(.*?)</div>~is', $source, $matches );

$count = count($matches[0]);
for($i=0;$i<$count;$i++){
$matches[0][$i] = str_replace('<button @click.prevent="showLongImage" class="ion-code-working">Obrazek zwinięty, kliknij aby rozwinąć</button>','',$matches[0][$i]);
$matches[0][$i] = str_replace('<a','<a target="_blank" ',$matches[0][$i]);
$checkVideo = get_string_between($matches[0][$i],'source="','.mp4"');
if(!empty($checkVideo)){
echo '
<video width="610" height="auto" controls>
<source src="'.get_string_between($matches[0][$i],'source="','.mp4"').'.mp4" type="video/mp4">
</video>
';
echo "<div style='height: 15px;'></div>";
} else {
echo "<h2>".get_string_between($matches[0][$i],'alt="','"')."</h2>";
echo $matches[0][$i];
echo "<div style='height: 15px;'></div>";
}
}

$nextPage = get_string_between($source,'<a href="https://kwejk.pl/strona/','"');
echo "<a href='index.php?page=$nextPage' style='color: #fff; text-decoration: none;'>Następna strona</a>";

?>
</CENTER>
</div>
Jeżeli kogoś tak wk*rwiają reklamy na kwejku, jak mnie...
0.067611932754517