Last active
January 30, 2019 21:47
-
-
Save PapeCoding/a9b669d18ebdf6b3e2b503938576282c to your computer and use it in GitHub Desktop.
Get all displayed tweets from a timeline as plaintext in single lines! This is very usefull to get data from twitter without having an api key. This especially works fine on the "advanced search"-results!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = ""; Array.from(document.getElementsByClassName("tweet-text")).forEach(function(t) {if(t.getAttribute("lang") == "en") a += t.innerText.replace(/\n|\s\s+/g, " ").trim() + "\n"}); var input = document.createElement("textarea"); document.querySelectorAll('.AppContent-main, .AppContent')[0].prepend(input); input.value = a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use it just open the console window with
CTRL+SHIFT+I
and paste the gist content and hitENTER
. On the top of the timeline a small textarea should appear containing your tweets text.Make sure to never paste code into your console that you have not checked for validity!