-
Notifications
You must be signed in to change notification settings - Fork 2
/
fb.php
55 lines (51 loc) · 1.29 KB
/
fb.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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
ini_set('display_errors', 0);
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$page_id = 'csinsit';
$access_token = ' 1167509093264725|kT0gwEHq7G-fvh7teSVxP4IKPGA';
//Get the JSON
$json_object = @file_get_contents('https://graph.facebook.com/csinsit/posts?access_token=1167509093264725|kT0gwEHq7G-fvh7teSVxP4IKPGA&fields=id,link,message,picture,description,story&limit=6');
//Interpret data
$fbdata = json_decode($json_object);
$a=[];$b=[];$c=[];$i=0;
foreach ($fbdata->data as $post)
{
$a[$i]= '<p><a href="' . $post->link . '"> <img src="' . $post->picture . '" /> </a></p>';
$b[$i]= '<p><a href="' . $post->link . '" style="color:black;">' . $post->story . '</a></p>';
$c[$i]= '<p><a href="' . $post->link . '" style="color:black; text-decoration:none;">' . $post->message . '</a></p>';
$i++;
}
for($j=0;$j<=$i;$j++){
$x.=$a[$j];
$x.=$b[$j];
$x.=$c[$j];
$y.=$a[$j+1];
$y.=$b[$j+1];
$y.=$c[$j+1];
?>
<div class="row">
<div class="col-md-6" style="text-align:center;font-family: 'Lato', sans-serif;font-weight:500">
<?php
echo $x;
?>
</div>
<div class="col-md-6" style="text-align:center;font-family: 'Lato', sans-serif;font-weight:500">
<?php
echo $y;
?>
</div>
</div>
<?php
$j++;
unset($x);
unset($y);
}
?>
</body>
</html>