Skip to content

Commit 4732917

Browse files
committed
Set an UA string with GitHub API requests
GitHub API requires an user-agent string to be present when making requests to their API. Close #464
1 parent 101b0c6 commit 4732917

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/github_activity.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public static function fetchActivity ($page = 1)
2323
{
2424
$ch = curl_init();
2525

26-
curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/orgs/AXR/events?page=' . $page);
26+
curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/orgs/axr/events?page=' . $page);
27+
curl_setopt($ch, CURLOPT_USERAGENT, 'http://axrproject.org');
2728
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2829

2930
$response = curl_exec($ch);

0 commit comments

Comments
 (0)