-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtempo.php
66 lines (56 loc) · 1.93 KB
/
tempo.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<center>
<a href="https://www.tempo.co/">
<img src="http://cdn.tmpo.co/web/teco/images/logo-tempo-small.gif" alt="Tempo.Co">
</a>
</center>
</div>
<div class="panel-body">
<?php
foreach($htmltem->find('a') as $linkjudul)
{
$link=str_replace("/", "", $linkjudul->href);
echo $link."<br>";
$linkambil=preg_match("/tempo.coread/", $link);
if ($linkambil)
{
$urlnya=$linkjudul->href;
echo $urlnya."<br>";
$pecah=explode('/',$urlnya);
$judul=str_replace("-"," ",$pecah[9]);
$judulketemu=preg_match("/".$qcari."/i", $judul);
if($judulketemu){
$t++;
/*echo "==============================================================================================<br>";*/
/*echo " Berita <b> CNN </b> dengan kata kunci: <b>".$qcari."</b>";*/
echo "<br>";
echo "<center>";
echo "<h4><p class='uppercase'>".$judul."</p></h4>";
echo "</center>";
echo "<a href='".$urlnya."'target='_blank'>".$urlnya."</a><br><br>";
$htmltem->load_file($urlnya);
foreach($htmltem->find('p') as $linkisi)
{
if ($linkisi)
{
$beritanya=str_replace("'","-",(strip_tags($linkisi)));
echo $beritanya."<br>";
/*echo "==============================================================================================<br>";*/
}
}break;
}//if
/*else if($judulketemu == FALSE)
{
echo "tidak ada berita";
}break;*/
}
}
?>
</div>
<div class="panel-footer">
<?php echo "<center> banyak berita tempo: ".$t."</center>"; ?>
</div>
</div>
</div><!--end col-6 -->