Skip to content

Commit

Permalink
fix: Fix Twitter fetching
Browse files Browse the repository at this point in the history
Twitter now returns a 429 HTTP error code when fetching
with Googlebot-compatible user agent. I don’t know if it's temporary,
but it seems to work with a simple `compatible; bot` user agent, so
let's try it.
  • Loading branch information
marienfressinaud committed Jan 6, 2022
1 parent 0e43593 commit e6dc2ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/LinkFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function fetchUrl($url)
// If we fetch Twitter, we need to alter our user agent to get
// server-side rendered content.
// @see https://stackoverflow.com/a/64332370
$options['user_agent'] = $this->http->user_agent . ' (compatible; Googlebot/2.1)';
$options['user_agent'] = $this->http->user_agent . ' (compatible; bot)';
}

if ($selected_ip) {
Expand Down

0 comments on commit e6dc2ca

Please sign in to comment.