-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrapephotos.php
86 lines (73 loc) · 1.76 KB
/
scrapephotos.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
<?
//ONE BING PHOTO
$safekeyword=str_replace(' ', '+', $keyword);
$agetpage='http://www.bing.com/images/search?q='.$safekeyword.'+band&view=detailv2';
$apage = file_get_contents($agetpage);
$aphoto = new DOMDocument();
$aphoto->loadHTML($apage);
$aitems = $aphoto->getElementsByTagName('img');
$alimit='2';
$acount='0';
$once='true';
foreach($aitems as $aitem)
{
if($acount!='0'){
if($acount<$alimit){
echo '<img style=" width: 100%; max-width: 320px; margin:auto; height: auto;" src="';
//echo $ppage.'/';
$alink=$aitem->getAttribute('src');
echo $alink.'" >';
if($once=='true'){
echo'<div class="background-image"></div>
<style>
.background-image {
background: #111111;
background-image: url("'.$alink.'");
background-size: cover;
display: block;
filter: blur(10px);
-webkit-filter: blur(10px);
height: 800px;
left: 0;
position: fixed;
right: 0;
top:150px;
z-index: -1;
opacity: 0.8;
}
</style>
';
$once='false';
}
}
}
$acount++;
}
/*
echo'<div class="pexpand">';
//MORE BING PHOTOS
$safekeyword=str_replace(' ', '+', $keyword);
$pgetpage='http://www.bing.com/images/search?q='.$safekeyword.'+band&view=detailv2';
$ppage = file_get_contents($pgetpage);
$photo = new DOMDocument();
$photo->loadHTML($ppage);
$items = $photo->getElementsByTagName('img');
$plimit='20';
$pcount='0';
$once='true';
foreach($items as $item)
{
if($pcount!='1'){
if($pcount<$plimit){
echo '<img style=" float: left; height: auto;" src="';
//echo $ppage.'/';
$link=$item->getAttribute('src');
echo $link.'" >';
///BG PHOTO///////
}
}
$pcount++;
}
echo'</div>';
*/
?>