-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
128 lines (121 loc) · 2.86 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
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
<?php //Bismillah
?>
<head>
<title>LikesHistory</title>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.min.css">
<style type="text/css">
body
{
/*background-color: #E9EAED;*/
}
.maintitle
{
color: #5c9ccc;
}
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 8pt; }
#all
{
display: inline-block;
position: relative;
overflow: visible;
}
.boxes
{
box-shadow: 3px 3px 10px #888888;
width: 300px;
min-height: 150px;
float: left;
padding: 5px;
margin: 5px;
}
.boxes:hover
{
box-shadow: 3px 3px 20px #888888;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript">
asif = {};
//GetBox
function getBox(id,type)
{
FB.api('/'+id, function(resp) {
var elem = '<div class="boxes status">';
elem += '<h3>'+resp.from.name+'</h3>';
elem += '<i>'+resp.updated_time+'</i><br>';
elem += '<p>'+resp.message+'</p>';
$(elem).appendTo('#all').hide().fadeIn();
});
}
//Load Likes
function loadLikes()
{
var cats = 'photo,album,event,group,note,link,video,application,status,check-in, review, comment, post';
cats = 'all';
var fql = "Select object_id, object_type from like where user_id=me() and object_type='status'";
fql = encodeURIComponent(fql);
FB.api("/fql?q="+fql,function(response) {
//Put everything into boxes
for (var i=0; i<response.data.length; i++)
{
getBox(response.data[i].object_id, response.data[i].object_type);
}
});
}
//DEV
function loginCheck()
{
if (FB.getUserID()=="")
{
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
});
loadLikes();
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'user_likes, read_stream'}
);
}
}
//Document Ready
$(document).ready( function() {
$("#dvMain").tabs();
$.getScript('//connect.facebook.net/en_UK/all.js', function(){
window.fbAsyncInit = function() {
FB.init({
appId: '169481549893709',
channelUrl: '//www.asifrc.com/channel.php',
});
loginCheck();//DEV
};
});
});
</script>
</head>
<body>
<div id="fb-root"></div>
<h1 class="maintitle">Likes History</h1>
<div id="dvMain">
<ul>
<li><a href="#all">All</a></li>
<li><a href="#photo">Photo</a></li>
<li><a href="#status">Status</a></li>
<li><a href="#post">Post</a></li>
</ul>
<?php
// photo, album, event, group, note, link, video, application, status, check-in, review, comment, post
?>
<div id="all">
</div>
<div id="photo">Photo</div>
<div id="status">Status</div>
<div id="post">Post</div>
</div>
Bismillah
<button onclick="loadLikes();">Load Likes</button>
</body>