forked from reference-project/taobao_thumb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
99 lines (95 loc) · 4.52 KB
/
index.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>淘宝图片抓取</title>
<meta name="author" content="陶留军">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link rel="stylesheet" href="http://libs.useso.com/js/bootstrap/3.2.0/css/bootstrap.min.css">
<style>
body {
font-family: "Microsoft Yahei";
background: #e6e6e6 url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAgMAAAANjH3HAAAAA3NCSVQICAjb4U/gAAAADFBMVEXX19fm5ube3t7r6+sdGJkMAAAACXBIWXMAAAsSAAALEgHS3X78AAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M1cbXjNgAABGJJREFUSIltVkGO5DYM1DkPyCPyH2rWAvaoAaT7PoUGWscFKIyUc54y/0kVJbt7JlFPo23TpIrFIjWhJ2sS1Q4ROeWsc8RHPvANwhVFD3NLmuP9sNRHDX3a9PVXm7PiM3jjlurPz3FKRlS5Vgn7IoqkqlELLpMVvBsQfv7PGiVMleE+JyM9o9Uwkw08j+seltRFkMIMs27/3uZJbA85KqMQgb7Jiw+87IhAMNOcBYnDp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NbF19FA8XW/jODeCZ1/Py8L9hJkKQd3R+PNLXlbcQO5JkfFvgEjdjamZ0dBRJavrDZfexUXzPcWUPpkHB2rNW0T7evSthWc+XdbsLKqLqCMmBr8sOyYsNV351LvKejeZ5zMKxkCO3gv5HvBynad+BPSta/HG8Ez9xDaghg66RV1v/gsXm78L6/uerAAAAABJRU5ErkJggg==") repeat;
}
.container-fluid {
padding-top: 10px;
padding-bottom: 10px;
}
.i-imgs > div {
display: inline-block;
margin: 0 20px 20px 0;
text-align: center;
}
.i-imgs > div img {
max-height: 200px;
max-width: 100%;
}
</style>
</head>
<body>
<div class="container-fluid" ms-controller="app">
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
<p><strong>淘宝图片抓取</strong></p>
<p>1、抓取淘宝商品的缩略图;</p>
<p>2、抓取淘宝商品的详情图;</p>
</div>
</div>
</div>
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-12">
<form class="form" action="#" method="post" onsubmit="javascript:return false;">
<div class="form-group">
<label class="form_control">商品网址:</label>
<input type="text" class="form-control" ms-duplex-value="form['url']" required placeholder="支持淘宝和天猫网址" style="width:800px;">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" ms-on-click="changeType('thumb')">抓取缩略图</button>
<button type="submit" class="btn btn-primary" ms-on-click="changeType('detail')">抓取详情图</button>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12 i-imgs">
<div ms-repeat="datas">
<a ms-attr-href="el" target="_blank">
<img ms-attr-src="el"><br>
[点击打开大图]
</a>
</div>
</div>
</div>
</div>
</body>
</html>
<script src="http://libs.useso.com/js/jquery/2.1.1/jquery.min.js" charset="utf-8"></script>
<script src="avalon.modern.min.js" charset="utf-8"></script>
<script>
(function(){
var app = avalon.define({
$id: 'app',
form: {url:null,type:null},
datas: [],
changeType: function(type){
app.form.type =type;
app.search();
},
search: function(){
app.datas.removeAll();
$.getJSON( './taobao.php' , app.form.$model , function(data){
app.datas = data;
});
}
});
avalon.scan();
app.form.url = 'http://item.taobao.com/item.htm?spm=a217f.1766217.1998475082.1.hISzwI&id=520035789858';
})();
</script>