아래 사이트에서 테스트 하실 수 있습니다.
https://codepen.io/wdevcode/pen/zWEEJJ
<html>
<head>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
</head>
<body>
<div>누가 날 차단했나 ? (who block me) / made in /steemit.com/@wdev">@wdev
사용방법 : 아래 ACCOUNT에 계정명을 입력한 이후 엔터를 입력하면 됩니다.
ACCOUNT :
txt" id="inpAccount">
divDisp">
// 누가 날 차단했는지 확인할 수 있다
// account : 계정
// startFollower : 조회 시작 계정명
// total : 조회된 계정 정보
function whoBlockMe(account, startFollower, total) {
const READ_COUNT = 999; // max read 999
total = total==undefined?[]:total;
// steem.api.getFollowers(following, startFollower, followType, limit, function(err, result)
steem.api.getFollowers(account, startFollower, null, READ_COUNT, function(err, result) {
try{
startFollower = result[result.length - 1].follower;
}catch(e){
alert( account + "는 존재하지 않는 ACCOUNT 입니다.");
}
result.forEach(res => {
if (res.what.length == 1 && res.what[0] == 'ignore') {
total.push(res.follower);
}
});
// 추가 정보가 있는 경우 더 읽어들인다.
if (result.length == READ_COUNT) {
whoBlockMe(account, startFollower, total);
}else{
// console.log("total : " + total);
var html = [];
html.push("total : " + total.length +"<br>");
total.forEach(item => {
html.push( "@"+item +"<br>"+ "<a href='https://steemit.com/@"+item+"' target='_blank'>https://steemit.com/@"+item+"
");
});
screenLock(false);
document.getElementById("divDisp").innerHTML = html.join("
");
}
});
return total;
}
// 화면을 잠금 처리한다
// flag : 잠금 여부
function screenLock(flag){
if(flag){
document.getElementById("divDisp").innerHTML = "please wait, now loading...";
}
document.getElementById("inpAccount").readOnly = flag;
}
</script>
<script>
document.getElementById("inpAccount").addEventListener('keypress', (e)=>{
var key = e.which || e.keyCode;
if (key === 13) { // 13 is enter
screenLock(true);
const account = document.getElementById("inpAccount").value.replace(/\@/,"");
whoBlockMe( account );
}
});
</script>
</html>