Permalink
Browse files

Fixed github updater tool to use RSS feed instead of old v2 of github…

…'s API
  • Loading branch information...
1 parent beb2d8c commit 6e521be074c5f7bf9decd4c9b693837341ca079c @mikeho mikeho committed Aug 15, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 cli/scripts/refresh-last-git.cli.php
@@ -1,14 +1,13 @@
<?php
function RefreshGitData($strRepository, $strRegistryName) {
- $strXml = file_get_contents('http://github.com/api/v2/xml/commits/list/qcodo/' . $strRepository . '/master');
+ $strXml = file_get_contents('https://github.com/qcodo/' . $strRepository . '/commits/master.atom');
$objXml = new SimpleXMLElement($strXml);
- $objMostRecentCommit = $objXml->commit[0];
- $strNodeName = 'committed-date';
- $dttCommit = new QDateTime((string) $objMostRecentCommit->$strNodeName);
-
- $strMessage = trim((string) $objMostRecentCommit->message);
+ $objMostRecentCommit = $objXml->entry[0];
+ $dttCommit = new QDateTime((string) $objMostRecentCommit->updated);
+
+ $strMessage = trim((string) $objMostRecentCommit->title);
$strDate = $dttCommit->__toString('DDDD, MMMM D, YYYY');
- $strUrl = 'https://github.com' . (string) $objMostRecentCommit->url;
+ $strUrl = (string)($objMostRecentCommit->link['href']);
// Cleanup Message
if (($intPosition = strpos($strMessage, "\n")) !== false) {

0 comments on commit 6e521be

Please sign in to comment.