From 357d7a4955830d690a16d52a6f91e351c813ab48 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 24 Dec 2020 10:04:59 +0100 Subject: [PATCH] src/Tweeper.php: set User-Agent to impersonate a Google crawler Set User-Agent to impersonate a Google crawler, this makes twitter.com return the old desktop UI which can be more easily scraped. This restore brings back support for twitter.com which has stopped serving the mobile UI which was still scrapeable somehow. --- src/Tweeper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tweeper.php b/src/Tweeper.php index 9dc1381..4a32f56 100644 --- a/src/Tweeper.php +++ b/src/Tweeper.php @@ -36,7 +36,7 @@ date_default_timezone_set('UTC'); */ class Tweeper { - private static $userAgent = "Mozilla/5.0"; + private static $userAgent = "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)"; private static $maxConnectionTimeout = 5; private static $maxConnectionRetries = 5; -- 2.1.4