Last active
August 4, 2020 20:08
-
-
Save baptx/c43dec50f13b9835dd5f4485255fc9e3 to your computer and use it in GitHub Desktop.
Revisions
-
baptx revised this gist
Aug 4, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ // copy tweets variable from tweets.js file of your Twitter archive var tweets = []; // Open this HTML file and execute the following JavaScript code in the web console (F12 or Ctrl+Shift+K shortcut) // A textarea will appear so you can copy/paste to save data as a CSV file /* var out = []; var length = tweets.length; -
baptx revised this gist
Aug 4, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ var out = []; var length = tweets.length; for (var i = 0; i < length; ++i) { var name, id; if (tweets[i].tweet.entities.user_mentions.length > 0) { name = tweets[i].tweet.entities.user_mentions[0].screen_name; id = tweets[i].tweet.entities.user_mentions[0].id_str; -
baptx created this gist
Aug 4, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ <script> // copy tweets variable from tweets.js file of your Twitter archive var tweets = []; // Open this HTML file and execute the following JavaScript code in the web console to get your CSV file /* var out = []; var length = tweets.length; for (var i = 0; i < length; ++i) { var id; if (tweets[i].tweet.entities.user_mentions.length > 0) { name = tweets[i].tweet.entities.user_mentions[0].screen_name; id = tweets[i].tweet.entities.user_mentions[0].id_str; } else { name = ""; id = ""; } out[i] = tweets[i].tweet.created_at + '\t"' + tweets[i].tweet.full_text.replace(/"/g, '""') + '"\t"""' + tweets[i].tweet.id_str + '"""\t' + name + '\t"""' // backup name with user ID to make sure it is the correct account (in case the mention order is not sorted) + id + '"""'; // backup first mentionned user ID to track a user who deleted a tweet you retweeted / favorited (even if the user changed his username) // CSV with tab separator: quote to allow multiline string; escape quote string delimiter with double quote; display large numbers correctly as string with triple quote } displayData(); function displayData() { var box = document.createElement("textarea"); box.value = out.join('\n'); document.body.appendChild(box); } */ </script>