Skip to content

Instantly share code, notes, and snippets.

@yusufusta
Last active September 14, 2019 13:54
Show Gist options
  • Save yusufusta/f020cf9f044cec4a954da2561139e58b to your computer and use it in GitHub Desktop.
Save yusufusta/f020cf9f044cec4a954da2561139e58b to your computer and use it in GitHub Desktop.
<?php
$kelime = "online üniversite";
$kelime = str_replace(" ","+",$kelime);
$sayfa = "1";
$eksiurl = "https://eksisozluk.com/?q=";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ''.$eksiurl.''.$kelime.'');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$a = curl_exec($ch);
$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
$kaynak = file_get_contents(''.$url.'?p='.$sayfa.'');
preg_match_all('#<div class="content">(.*?)</div>#si', $kaynak, $entry);
preg_match_all('/<a.*class=\"entry-date permalink\".*>(.*)<\/a>/isU', $kaynak, $tarih);
preg_match_all('/<a.*class=\"entry-author\".*>(.*)<\/a>/isU', $kaynak, $sahibi);
print_r($tarih[1]);
print_r($sahibi[1]);
print_r($entry[0]);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment