-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
74 lines (71 loc) · 2.87 KB
/
post.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
67
68
69
70
71
72
73
74
<html>
<head>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</head>
<body>
<div class="container mt-5">
<div class="row">
<div class="col-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">Get toàn bộ bài báo</h5> <br>
<a href="#" onclick="xuli('vnexpress')">
🔥 VNexpress.net
</a> <br> <br>
<a href="#" onclick="xuli('dantri')">
🔥 Dantri.com.vn
</a> <br> <br>
<a href="#" onclick="xuli('tuoitre')">
🔥 Tuoitre.vn
</a>
<br>
<div class="text-center mt-3">
<a href="#" class="mt-3 btn btn-primary">Submit</a>
</div>
</div>
</div>
</div>
<div class="col-8">
<div class="card">
<div class="card-body binh">
</div>
</div>
</div>
</div>
</div>
<style>
a:hover{
text-decoration: none;
}
a{
color: black;
}
</style>
<script>
function xuli(host){
$.post('./crawl_post.php',{
host: host
}, (data)=>{
$('.binh').html(data);
$('a').attr('href', '#');
});
}
function run(host, url){
$.ajax({
url: 'http://localhost:5000?host='+host+"&url="+url,
type: "GET",
beforeSend: function(xhr){xhr.setRequestHeader('Access-Control-Allow-Origin', '*');},
success: function(data) {
data = data.data;
if(host == "vnexpress") host = "Vnexpress.net";
else if(host == "dantri") host = "Dantri.com.vn";
else host = "tuoitre.vn";
window.open('http://localhost/generate_news_img/?title='+data.title+'&content='+data.content+'&image='+data.image+'&time='+data.time+"&host="+host,"_blank");
}
});
}
</script>
</body>
</html>