Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: /* Open Foundation profile followers list in new tab */
- ((s, t, w, z) => {
- if ((location.hostname === "foundation.app") && window.__NEXT_DATA__) {
- fetch("https://hasura2.foundation.app/v1/graphql", {
- method: "POST",
- headers: {"Content-Type": "application/json"},
- body: JSON.stringify({
- query: "query UserFollowing($publicKey: String!, $currentUserPublicKey: String!, $offset: Int!, $limit: Int!) {\n user: user_by_pk(publicKey: $publicKey) {\n following(where: {isFollowing: {_eq: true}}, offset: $offset, limit: $limit) {\n id\n user: userByFollowedUser {\n name\n username\n profileImageUrl\n userIndex\n publicKey\n isFollowingUser: follows_aggregate(\n where: {user: {_eq: $currentUserPublicKey}, isFollowing: {_eq: true}}\n) {\n aggregate {\n count\n}\n}\n}\n}\n}\n}\n",
- variables: {publicKey: __NEXT_DATA__.props.pageProps.user.publicKey, currentUserPublicKey: "", limit: 3000, offset: 0}
- })
- }).catch(e => {
- alert("Failed to retrieve followers data.\n" + e)
- }).then(r => {
- r.json().catch(e => {
- alert("Failed to parse followers data.\n" + e)
- }).then(o => {
- s = `<!doctype html><head><meta charset="utf-8"><title>${__NEXT_DATA__.props.pageProps.user.name} followers</title><base href="https://foundation.app/"><style>body{font:14pt/normal sans-serif}ol{column-count:2}img{vertical-align:middle;border-radius:50%;width:2em;height:2em}</style></head><body><ol>`;
- (t = document.createElement("LI")).innerHTML = `<a><img /> <span></span></a>`
- o.data.user.following.forEach(i => {
- t.firstChild.href = `/@${i.user.username}`;
- t.firstChild.firstChild.src = i.user.profileImageUrl;
- t.firstChild.lastChild.textContent = i.user.name;
- s += t.outerHTML
- });
- w = open("about:blank");
- w.document.write(s + "</ol></body></html>");
- w.document.close()
- })
- })
- } else alert("Must be in a Foundation profile page")
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement