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 characters
| ''' | |
| Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3 | |
| Usage: python server-cors | |
| ''' | |
| import http.server as httpserver | |
| class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler): | |
| def send_head(self): | |
| """Common code for GET and HEAD commands. |
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 characters
| /* Twitter API 1.1 tweets / favorites (likes) / following / followers backup in web browser | |
| * Get your access keys to use Twitter API 1.1: https://dev.twitter.com/docs/auth/tokens-devtwittercom | |
| * You can change Twitter API URL and Twitter screen_name, then execute script from a trusted web page without CSP protection like about:blank in a web browser console (F12 or Ctrl+Shift+K shortcut) | |
| * A textarea will appear so you can copy/paste to save data as a CSV file or search tweets / users in your web browser (Ctrl+F shortcut) | |
| * You can then view your backup in a spreadsheet editor like LibreOffice Calc | |
| * You can also compare the backup with another one to see who unfollowed you, who changed their Twitter username by looking at the user ID or which tweet you retweeted / favorited was deleted (e.g. with the Linux diff command) | |
| * | |
| * Note about the tweets backup: | |
| * Usually you will search tweets that you retweeted using Twitter web version (https://twitter.com/search) with a search like "from:your_username f |