diff --git a/lib/ApiFetcher.lib.php b/lib/ApiFetcher.lib.php index 37f9189..0c1a7b9 100644 --- a/lib/ApiFetcher.lib.php +++ b/lib/ApiFetcher.lib.php @@ -49,7 +49,11 @@ class ApiFetcher { // Make the actual URL that will be requested $requesturl = $url . "?" . implode("&", $urlparams); - $content = file_get_contents($requesturl); + $content = file_get_contents($requesturl, false, stream_context_create([ + "http" => [ + "header" => "User-Agent: Mozilla/5.0 (PHP) See source.netsyms.com" + ] + ])); // Only insert into db if it didn't fail horribly if ($content !== FALSE) { diff --git a/lib/NewsCategory.lib.php b/lib/NewsCategory.lib.php index b45d2e0..578b651 100644 --- a/lib/NewsCategory.lib.php +++ b/lib/NewsCategory.lib.php @@ -21,14 +21,14 @@ class NewsCategory { const SOCIAL = 128; const CATEGORIES = [ - self::BUSINESS => "Business", - self::ENTERTAINMENT => "Entertainment", - self::GENERAL => "General", - self::HEALTH => "Health", - self::SCIENCE => "Science", - self::SPORTS => "Sports", - self::TECHNOLOGY => "Technology", - self::SOCIAL => "Social" + self::BUSINESS => "business", + self::ENTERTAINMENT => "entertainment", + self::GENERAL => "general", + self::HEALTH => "health", + self::SCIENCE => "science", + self::SPORTS => "sports", + self::TECHNOLOGY => "technology", + self::SOCIAL => "social" ]; public function __construct(int $category) {