-
Notifications
You must be signed in to change notification settings - Fork 548
/
yahoo.html
39 lines (31 loc) · 913 Bytes
/
yahoo.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
<!DOCTYPE html>
<link rel="stylesheet" href="/adorn/adorn.css"/>
<script src="/adorn/adorn.js" async></script>
<script src="client_ids.js"></script>
<script src="../src/hello.polyfill.js"></script>
<script src="../src/hello.js"></script>
<script src="../src/modules/yahoo.js"></script>
<title>hello( yahoo )</title>
<h1>hello( yahoo )</h1>
<button id='login' onclick="login('yahoo');">Yahoo</button>
<div id="result"></div>
<script class="pre">
function login(network){
var yahoo = hello(network);
yahoo.login().then(function(){
// Get Profile
return yahoo.api('me');
}).then(function(p) {
document.getElementById('login').innerHTML = "<img src='"+ p.thumbnail + "' width=24/>Connected to "+ network+" as " + p.name;
}).then(null, function(e) {
console.error(e);
});
}
hello.init({
'yahoo' : YAHOO_CLIENT_ID
},
{
redirect_uri:'../redirect.html',
oauth_proxy: OAUTH_PROXY_URL
});
</script>