Skip to content

Commit

Permalink
Add a user-agent to our Reddit requests, to avoid being blocked.
Browse files Browse the repository at this point in the history
Fixes #3.
  • Loading branch information
icculus committed May 9, 2023
1 parent fd88a89 commit f58a804
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions feed/index.php
Expand Up @@ -193,6 +193,7 @@ function recache($subreddit, $fname, $url)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "php:inline-reddit.com:v1.1.7");
$jsondata = curl_exec($ch);
curl_close($ch);
if ($jsondata === false)
Expand Down

0 comments on commit f58a804

Please sign in to comment.