67 points · by kordlessagain · 3y ago · 32 comments
from flask import Flask
import requests
app = Flask(__name__)
@app.route('/<path:url>')
def proxy(url):
return requests.get(f'https://twitter.com/{url}', headers={'User-Agent': 'Googlebot'}).text
if __name__ == '__main__':
app.run()It's really easy to let these habits control you.
The recent mayhem has given me another opportunity to try at a clean break.
Deleting my account doesn't destroy my data, everything still exists, it's just not visible to me anymore. But deletion allows someone else to use my handle.
I heard yesterday that they already blocked googlebot and got delisted, but I didn't confirm, and I guess that was false.
I imagine it will be rolled-back in the next week as it becomes clear to advertisers how much lower value tweets are
With Twitter's data being public, bots and data analyzers can just scrape the site instead of paying for the now extremely expensive API. Not only does this mean Twitter isn't getting paid, but scraping puts a lot more load on Twitter servers than equivalent API usage.
Who ever scraped a page and doesn't know to try referrer, user-agent and all other 101 tricks in the book?
(I can't, offhand, figure out if they got a special uniform, but I do hope so.)
They now use a more civil law-ish approach to this.
pip install Flask
Save the code to `elon.py` and then run it: python elon.py
Use http://localhost:5000/<twitter_handle> to view a user's page without being forced to login.https://techcrunch.com/2023/07/05/twitter-silently-removes-l...