-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteemitapi98.html
51 lines (45 loc) · 1.81 KB
/
steemitapi98.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
46
47
48
49
50
51
<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://github.com/steemit/steem-js/releases/download/v0.7.7/steem.min.js"></script>
<script>
var username;
function saveUserName(){
username = window.location.hash;// #username
if (username == null || username.trim().length == 0){
username = "#steemitblog";
}
username = username.substr(1);//#を取る
username = decodeURI(username).trim();//デコード、トリム
}
var permlink;
function getDiscussionsByBlog(){
steem.api.getDiscussionsByBlog({tag: username, limit: 1}, function(err, results) {
if(results.length == 0){
return;
}
permlink = results[0].permlink;
getActiveVotesAsync();
});
}
async function getActiveVotesAsync(){
let result2 = await steem.api.getActiveVotesAsync("yasu", permlink);
}
window.onload = function() {
steem.api.setOptions({url: 'https://api.steemit.com'});
saveUserName();
getDiscussionsByBlog();
//getActiveVotesAsync();
};
</script>
</head>
<body>
<div>
こんにちは、
</div>
<h1 id="permlink"></h1>
</body>
</html>