-
Notifications
You must be signed in to change notification settings - Fork 54
/
index.php
122 lines (71 loc) · 1.89 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
include('dom.php');
$url = $_GET[“url”];
$html = file_get_html($url);
$links = array();
foreach($html->find('h1[class="product-name"]') as $a) {
$links[] = $a->plaintext;
}
$title = $links[0] ;
///////////
$var1 = array();
foreach($html->find('a[id*="sku-1"]') as $a) {
$var1[] = $a->title;
}
////////////
$var2 = array();
foreach($html->find('a[id*="sku-2"]') as $a) {
$var2[] = $a->innertext;
}
////////////
////////////
$shipd = array();
foreach($html->find('li[class="packaging-item"]') as $a) {
$shipd[] = $a->innertext;
}
$links = array();
foreach($html->find('span[id="j-sku-price"]') as $a) {
$links[] = $a->innertext;
}
$price = $links[0];
$length = count($var1);
for ($i = 0; $i < $length-1; $i++) {
$xvar1 = $xvar1 . $var1[$i] . "|" ;
}
$xvar1 = $xvar1 . $var1[$i] ;
/////////
$url = explode("?",$url);
$url = $url['0'];
echo " { url :" . $url . "}<br>";
echo " { title :" . $title . "}<br>";
echo " { price :" . $price. "}<br>";
foreach($html->find('span[class="percent-num"]') as $a) {
echo " { Rating :" . $a->plaintext . "}<br>";
}
foreach($html->find('span[class="order-num"]') as $a) {
echo " { Orders:" . $a->plaintext . "}<br>";
}
echo " { variation 1 :" . $xvar1 . "}<br>";
$length = count($var2);
for ($i = 0; $i < $length-1; $i++) {
$xvar2 = $xvar2. $var2[$i] . "|" ;
}
$xvar2 = $xvar2 . $var2[$i] ;
echo " { variation 2 :" . $xvar2 . "}<br>";
$length = count($shipd);
for ($i = 0; $i < $length; $i++) {
echo " {" . $shipd[$i] . "}<br>" ;
}
foreach($html->find('li[class="property-item"]') as $a) {
echo " {" . $a->plaintext . "}<br>";
}
echo "<br><br>{ variation Pictures : <br>" ;
$length = count($var1);
for ($i = 0; $i < $length; $i++) {
$temp = 'img[title="' . $var1[$i] .'"]' ;
foreach($html->find($temp) as $a) {
echo " { $var1[$i] : " . $a->bigpic . "}<br>";
}
}
echo " } " ;
?>