forked from MrSwitch/hello.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activities.html
45 lines (37 loc) · 1.19 KB
/
activities.html
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
<!DOCTYPE html>
<html>
<head>
<title>hello.js - demo - activities</title>
<link rel="stylesheet" href="/adorn/adorn.css" />
<script src="/adorn/adorn.js" async></script>
<script src="client_ids.js"></script>
<style>ul:empty:after{content:'empty';font-weight:bold;color:#aaa;}</style>
<script src="../src/hello.polyfill.js"></script>
<script src="../src/hello.js"></script>
<script src="../src/modules/facebook.js"></script>
<script src="../src/modules/google.js"></script>
</head>
<body>
<h1>hello.js - me/share</h1>
<button onclick="getActivities('google')">Get activities from Google</button>
<button onclick="getActivities('facebook')">Get activities from Facebook</button>
<h2>Activities list</h2>
<ul id="list"></ul>
<script class="pre">
function getActivities(network){
var hi = hello(network);
hi.login({scope:'share'}).then(function(){
// Get the friends
hi.api('me/share').then(function(r){
r.data.forEach(function(o){
var li = document.createElement('li');
li.innerHTML = o.name || o.message || o.story || o.title;
document.getElementById('list').appendChild(li);
});
});
});
}
hello.init( CLIENT_IDS, {redirect_uri:'../redirect.html'} );
</script>
</body>
</html>