<?php
   function getir($baslangic, $son, $cekilmek_istenen) {
@preg_match_all('/' . preg_quote($baslangic, '/') .
'(.*?)'. preg_quote($son, '/').'/i', $cekilmek_istenen, $m);
return <span class="userTag">@$m[</span>1];
}

$url = "https://twitter.com/search?f=tweets&vertical=default&q=istanbul";
$icerik = file_get_contents($url);
$zaman = getir('profile-tweet-action-reply-count-aria-','">',$icerik);

$liste = array();
if(file_exists("istanbul.txt")) {
$liste = json_decode(file_get_contents($liste), true);
}
?>
<html>
<body>
<?php
foreach($zaman as $tweetid) {
if(in_array($tweetid, $liste))
continue;

$liste[] = $tweetid;
?>
<blockquote class="twitter-tweet" data-lang="tr"><a href="https://twitter.com/twitter/status/<?php print_r($tweetid);?>"></blockquote>
<?php
}
?>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</body>
</html>
<?php
file_put_contents("istanbul.txt", json_encode($liste));
?>