projects
/
tweeper.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f3e62d
)
Revert "src/Tweeper.php: only override the User-Agent to a mobile one for twitter...
author
Antonio Ospite <ao2@ao2.it>
Fri, 18 Dec 2020 21:29:59 +0000
(22:29 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Fri, 18 Dec 2020 21:29:59 +0000
(22:29 +0100)
This reverts commit
b922824bc561f7f3e31c6f9962d96e9084497ced
.
src/Tweeper.php
patch
|
blob
|
history
diff --git
a/src/Tweeper.php
b/src/Tweeper.php
index
f1d579f
..
b794368
100644
(file)
--- a/
src/Tweeper.php
+++ b/
src/Tweeper.php
@@
-36,7
+36,7
@@
date_default_timezone_set('UTC');
*/
class Tweeper {
*/
class Tweeper {
- private static $userAgent = "Mozilla/5.0";
+ private static $userAgent = "Mozilla/5.0
(Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J)
";
private static $maxConnectionTimeout = 5;
private static $maxConnectionRetries = 5;
private static $maxConnectionTimeout = 5;
private static $maxConnectionRetries = 5;
@@
-455,15
+455,7
@@
class Tweeper {
return NULL;
}
return NULL;
}
- // Override User-Agent for twitter.com to force it to serve the mobile UI.
- if ($host == "twitter.com") {
- $user_agent = "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J)";
- }
- else {
- $user_agent = NULL;
- }
-
- $html = Tweeper::getUrlContents($src_url, $user_agent);
+ $html = Tweeper::getUrlContents($src_url);
if (FALSE === $html) {
trigger_error("Failed to retrieve $src_url", E_USER_WARNING);
return NULL;
if (FALSE === $html) {
trigger_error("Failed to retrieve $src_url", E_USER_WARNING);
return NULL;