-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrightsidemebot.php
47 lines (37 loc) · 959 Bytes
/
brightsidemebot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
set_time_limit(0);
function getData($data,$startTag,$finishTag){
$data= explode($startTag,$data);
$data= $data[1];
$data= explode($finishTag,$data);
$data= $data[0];
return $data;
}
//for ($b = 1; $b <= 2; $b++) {
$site = "http://brightside.me/thebest/page1/";
$data = file_get_contents($site);
preg_match_all('/<h3 class="al-title">.*?>.*?<\/h3>/si', $data, $download);
//print_r($download);
foreach($download as $d)
{
$sayi = 1;
$toplam = count ($d);
for ($s = 0; $s <= $toplam; $s++) {
$sitegelen= getData($d[$s],'href="','"');
$sitegelen='http://www.brightside.me'.$sitegelen;
$verim = file_get_contents($sitegelen);
$baslik= getData($verim,'<meta property="og:title" content="','" />');
preg_match_all('/<div id=".*?>.*?<\/span>/si', $verim, $gc);
foreach($gc as $a)
{
$toplama = count($a);
for ($i = 1; $i <= $toplama; $i++) {
$sayi++;
echo $resimler= getData($a[$i],'<img src="','"');
echo '<br>';
}
}
}
}
//}
?>