function parseUser(user) { const html = `
${pfp(user.user_id)}
${user.firstname + ' ' + user.lastname} Joined ${parseDate(new Date(user.date))} Gender: ${user.gender} Birthday: ${parseMonth(user.month) + ' ' + user.day + ', ' + user.year} User ID: ${user.user_id}
` return html } function render() { const html = `
${data.users.map(u => parseUser(u)).join('')}
` append(html) const load = `
Load more users
` append(load) } var page = 0 var data = { users: [] } async function loadMore() { let users = await load() const users_block = document.getElementById("users") for (user of users) { append(parseUser(user), users_block) } } async function load() { let request = await loadself() if (request.status === 429) { header(false, true) throw new Error("Rate limited"); } const self = request.json header(false, true, self.user_id) const users = (await loaduserspage(page)).json if (users.length === 0) { page = -1 remove('load') } else { page++ } return users } async function init() { let users = await load() data.users.push(... users) render() } init()