forked from winardiaris/newsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuntitled.php
More file actions
67 lines (52 loc) · 1.82 KB
/
Copy pathuntitled.php
File metadata and controls
67 lines (52 loc) · 1.82 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
<?php
include("static/inc/function.php");
$url_="batam.tribunnews.com/";
$media = UbahSimbol("batam.tribunnews");
$container = UbahSimbol("div#article");
$title = UbahSimbol("h1");
$date = UbahSimbol("div.grey h3");
$date_split =UbahSimbol("3|2|1");
$news_content = UbahSimbol("div.txt-article");
$writer = UbahSimbol("div[class=f11 grey]");
$image = UbahSimbol("div.imgfull_div img");
$a="";
$sql = "INSERT INTO `newsd`.`media_prefix` (`media_prefix_id`, `media_`, `media_prefix_url`, `media_prefix_container`, `media_prefix_title`, `media_prefix_date`, `media_prefix_date_split`, `media_prefix_news_content`, `media_prefix_writer`, `media_prefix_image`, `media_prefix_status`) VALUES ".PHP_EOL;
for($thn=2008;$thn<=2016;$thn++){
$x="";
for($bln=1;$bln<=12;$bln++){
if($bln<10){
$bln = "0".$bln;
}
$url = $url_.$thn."/".$bln."/";
$id = md5($url) ;
$x .= "('".$id."','".$media."','".UbahSimbol($url)."','".$container."','".$title."','".$date."','".$date_split."','".$news_content."','".$writer."','".$image."','1'),".PHP_EOL;
}
$a .=$x;
}
$sql .=$a;
$sql = substr($sql,0,-2);
echo $sql;
//$url_="batam.tribunnews.com/";
//$media = UbahSimbol("batam.tribunnews");
//$container = UbahSimbol("div#article");
//$title = UbahSimbol("h1");
//$date = UbahSimbol("h3");
//$date_split =UbahSimbol("3|2|1");
//$news_content = UbahSimbol("div.txt-article");
//$writer = UbahSimbol("div[class=f11 grey]");
//$image = UbahSimbol("div.imgfull_div img");
//$a="";
//$sql = "delete from `newsd`.`media_prefix` where ";
//for($thn=2008;$thn<=2016;$thn++){
//$x="";
//for($bln=1;$bln<=12;$bln++){
//$url = $url_.$thn."/".$bln."/";
//$id = md5($url) ;
//$x .= "`media_prefix_id`='".$id."' or " ;
//}
//$a .=$x;
//}
//$sql .=$a;
//$sql = substr($sql,0,-4);
//echo $sql;
?>