Rev 48 | Rev 56 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 48 | Rev 49 | ||
---|---|---|---|
Line 262... | Line 262... | ||
262 | return $t; |
262 | return $t; |
263 | } |
263 | } |
264 | 264 | ||
265 | function github_commit_count($user, $repo) { |
265 | function github_commit_count($user, $repo) { |
266 | $cont = file_get_contents("https://github.com/$user/$repo"); |
266 | $cont = file_get_contents("https://github.com/$user/$repo"); |
267 | if (preg_match('@<strong>(\\d+)</strong>\s*<span aria-label="Commits on master">commits</span>@smU', $cont, $m)) { |
267 | if (preg_match('@<strong>(\\d+)</strong>\s*<span[^>]+aria-label="Commits on master"[^>]*>commits</span>@smU', $cont, $m)) { |
268 | return $m[1]; |
268 | return $m[1]; |
269 | } else { |
269 | } else { |
270 | return "?"; |
270 | return "?"; |
271 | } |
271 | } |
272 | } |
272 | } |