-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbGroupCrawler.php
More file actions
46 lines (29 loc) · 1.06 KB
/
fbGroupCrawler.php
File metadata and controls
46 lines (29 loc) · 1.06 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
<?php
class fbGroupCrawler {
protected $token;
protected $group_id;
function __construct($group_id) {
$this->token = 'CAACEdEose0cBAJ78sBR0YfZCIfXs5qDByJrBrsFJBKyF7HGjZAKreCXzUALgA4ZAufzrcuOmpfGvdbPTA18VtcpCZBegtStKZAwLwYTibRUdnQMT3eqmQ0D9ojMvLtbEH2YB8dmaGaUK0rGdjhMpVfXbF44B5pKeD9sZBjZAZCs38ZAziMPlA1Lg3TDN8TrfVadn3uaDAmqGbhRWBdetQ3GxYhWH2aKu61YZCTfMakydXwxQZDZD';
$this->group_id = $group_id;
}
function revalidateToken() {
}
function run() {
$ch = curl_init();
$url = 'https://graph.facebook.com/v2.2/'.$group_id.'/feed';
//echo $url."\n";
$postData = "url=" . urlencode($url)
. "&message=" . urlencode('')
. "&access_token=" .$this->token;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$res = curl_exec($ch);
curl_close($ch);
$json = json_decode($res, true);
print_r($json);
}
}