forked from winardiaris/clipdig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_data_from_newsd.php
More file actions
77 lines (57 loc) · 1.87 KB
/
get_data_from_newsd.php
File metadata and controls
77 lines (57 loc) · 1.87 KB
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
67
68
69
70
71
72
73
74
75
76
77
<?php
include ("static/inc/con.php");
include ("static/inc/function.php");
include ("static/inc/conf.php");
include ("form/simple_html_dom.php");
$target = "http://202.146.128.250:8222/search.php?search=$DefaultSearch";
$html = file_get_html($target);
$kode ="";
$media ="";
$title ="";
$date ="";
$news_content ="";
$writer ="";
$image ="";
$url ="";
foreach($html->find('div[itemprop=count_data]') as $a){
$count = $a->plaintext;
}
foreach($html->find('div[itemprop=news_data]') as $news_data){
$kode = $news_data->id;
foreach($news_data->find('div[itemprop=title]') as $b){
$title = $b->plaintext;
}
foreach($news_data->find('div[itemprop=date]') as $c){
$date = $c->plaintext;
}
//foreach($news_data->find('div[itemprop=news_content]') as $d){
//$news = $d->plaintext;
//}
foreach($news_data->find('div[itemprop=writer]') as $e){
$writer = $e->plaintext;
}
foreach($news_data->find('div[itemprop=image]') as $f){
$image = $f->plaintext;
}
foreach($news_data->find('div[itemprop=url]') as $g){
$url = $g->plaintext;
}
foreach($news_data->find('div[itemprop=media]') as $h){
$media = $h->plaintext;
}
$target2 = "http://202.146.128.250:8222/get_content_db.php?kode=$kode";
$html2 = file_get_html($target2);
$news = $html2->find('news',0)->plaintext;
//echo "Kode:".$kode.PHP_EOL;
//echo "media:".$media.PHP_EOL;
//echo "title:".$title.PHP_EOL;
//echo "date:".$date.PHP_EOL;
//echo "news content:".$news.PHP_EOL;
//echo "writer:".$writer.PHP_EOL;
//echo "url:".$url.PHP_EOL;
//echo "image:".$image.PHP_EOL;
//echo "time:".$NOW.PHP_EOL;
echo $NOW."-------------------------------------------------------------------------------------------------------".PHP_EOL;
save_data_from_newsd($DefaultSearch,$kode,$media,$title,$date,$news,$writer,$url,$image,$NOW);
}
?>