-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
71 lines (41 loc) · 1.28 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
<?php
//call the class using require_once //better for error checking
require_once 'classes/Url.php';
if (isset($_POST['submit'])) {
$test = $_POST['url'];
$getSite = new URL();
//for performance improvement
$getSite->SetConnTime(8);
$filter_url = $getSite->FilterUrl($test);
$getSite->SetUrl($filter_url[0][0]);
$data = $getSite->GetData();
//getting all data into array
//print_r($data);
echo $data['title'];
echo '<br>';
echo $data['url'];
echo '<br>';
echo $data['slug'];
echo '<br>';
//keywords
echo $data['keywords'];
echo '<br>';
//description
//echo $data['description'];
print_r($data['description']);
echo '<br>';
//echo $data['screenshot'];
//printing the screenshort
echo '<img src="data:image/png;base64,'.$data['screenshot'].'" alt="Red dot" />';
echo '<br>';
//image if you want print all images using foreach loop
if (isset($data['images'][0][1])) {
echo $data['images'][0][1].'/>';
}
}
?>
<form action='' method='post'>
<input type="text" name="url">
<br/>
<input type="submit" name="submit">
</form>