-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
140 lines (128 loc) · 3.78 KB
/
Copy pathindex.php
File metadata and controls
140 lines (128 loc) · 3.78 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<html>
<head>
<title>Getting Data......</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
.header h1{
font-weight: bolder;
text-align: center;
}
form,table{
margin-top: 20px;
}
.well{
background-color: white;
box-shadow: 0px 0px 10px rgba(220,220,220,0.2);
}
.well:hover{
box-shadow: 0px 0px 10px grey;
z-index: 10;
}
body{
background-color: rgba(220,220,220,0.3);
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<section class="content bgcolor-3">
<div class="header col-lg-offset-2 col-lg-8">
<h1>YOUTUBE CHANNEL ID </h1>
<h1> FINDER</h1>
<div class="col-lg-offset-3 col-lg-6">
<form action ="index.php" method="post">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="keyword">
<div class="input-group-btn">
<button class="btn btn-danger" type="submit" name="submit">Search</button>
</div>
</div>
</form>
</div>
</div>
<div class="well col-lg-offset-1 col-lg-10 col-lg-offset-1">
<table class="table table-responsive table-bordered table-striped table-centered table-hovered">
<thead>
<th>ChannelName</th>
<th>ChannelID</th>
<th>FacebookUrl</th>
<th>Country</th>
</thead>
<tbody>
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
if(isset($_POST['submit']))
{
$ur= $_POST['keyword'];
$ur=explode(",",$ur);
$cu=count($ur);
$fbid=" ";
for($i=0;$i<$cu;$i++)
{
$url="https://www.youtube.com/user/".$ur[$i];
$url="https://www.youtube.com/user/".$ur[$i]."/about";
$html = new DOMDocument();
@$html->loadHtmlFile($url);
$xpath = new DOMXPath( $html );
echo "<tr>";
echo "<td>".$ur[$i]."</td>";
$nodelist = $xpath->query( "//meta[@itemprop='channelId'] " );
foreach ($nodelist as $chid )
{
session_start();
$chlid="";
$chlid=$chid->getAttribute('content');
/*$country=$area->nodeValue;*/
echo "<td>".$chlid."</td>";
session_destroy();
break;
}
$fb = $xpath->query( "//a[@title='Facebook']" );
foreach ($fb as $id)
{
session_start();
/* $fbid="";*/
$fbid=$id->getAttribute('href');
if(!$id)
{
echo "<td>"."NA"."</td>";
}
else
{
echo "<td>".$fbid."</td>";
}
session_destroy();
break;
}
if(!$fbid)
{
echo "<td>"."NA"."</td>";
}
$loc= $xpath->query( "//span[@class='country-inline']" );
foreach ($loc as $area )
{
session_start();
$country="";
$country=$area->nodeValue;
echo "<td>".$country."</td>";
echo "</tr>";
echo "<br>";
session_destroy();
break;
}
}
}
?>
</tbody>
</table>
</section>
</div>
</div>
</body>
</html>