Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copy a CSV of your followers to your clipboard
// put this in the console on https://twitter.com/<username/followers
timer = setInterval(() => window.scrollTo(0, document.body.scrollHeight), 100);
// wait until the document stops scrolling...
clearInterval(timer);
// this will copy the CSV to your clipboard
copy(
[...document.querySelectorAll(".ProfileCard-userFields")]
.map(e => ({
name: e.querySelector("a.fullname").innerText,
screenname: e.querySelector(".username").innerText,
bio: e.querySelector(".ProfileCard-bio").innerText,
}))
.map(f =>
[
JSON.stringify(f.name),
JSON.stringify(f.screenname),
JSON.stringify(f.bio),
].join(","),
)
.join("\n"),
);
@maniart
Copy link

maniart commented Oct 26, 2017

@brianloveswords what's copy?

@maniart
Copy link

maniart commented Oct 26, 2017

Looks v neat!

@maniart
Copy link

maniart commented Oct 26, 2017

ah gotcha. its binary should be in the path.

@brianloveswords
Copy link
Author

brianloveswords commented Oct 26, 2017

@maniart copy() is a command that's in browser devtools, like clear(), that copies things to the clipboard.

@maniart
Copy link

maniart commented Nov 3, 2017

@brianloveswords AAAAH gotcha

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