Skip to content

Instantly share code, notes, and snippets.

@ed-cooper
Last active September 15, 2021 19:36
Show Gist options
  • Save ed-cooper/bb561eadad84a6d8c116ed0e97358717 to your computer and use it in GitHub Desktop.
Save ed-cooper/bb561eadad84a6d8c116ed0e97358717 to your computer and use it in GitHub Desktop.
Returns all the followers of the Scratch user
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src='http://code.jquery.com/jquery-latest.min.js'>
</script>
<script>
// Original code by @griffpatch ( https://scratch.mit.edu/users/griffpatch/ )
var username = "chooper100"; // Replace with your username
var page = 1;
function load(e) {
$.get("https://scratch.mit.edu/users/" + username + "/followers/?page=1", loaded);
}
function loaded(data) {
var $dom = $(data);
var $users = $dom.find('span.title').children();
var $out = $('#result');
for (var i=0; i < $users.length; i++) {
var user = $users[i].text.trim();
$out.prepend(user + '<br>');
}
page++;
$.get("https://scratch.mit.edu/users/" + username + "/followers/?page=" + page, loaded);
}
</script>
</head>
<body onload="load(event);">
<div id='result'></div>
</body>
</html>
@SnowballUser20
Copy link

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment