Skip to content

Commit 00710d6

Browse files
committed
Uses parsed URL from API
1 parent 13f2e22 commit 00710d6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/jquery.github.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ function GithubRepo( repo ) {
66
this.name = repo.name;
77
this.open_issues = repo.open_issues;
88
this.pushed_at = repo.pushed_at;
9-
this.url = repo.url;
9+
this.url = repo.html_url;
1010
this.stargazers = repo.stargazers_count;
1111
}
1212

1313
// Parses HTML template
1414
GithubRepo.prototype.toHTML = function () {
15-
this.pushed_at = this._parsePushedDate( this.pushed_at ),
16-
this.url = this._parseURL( this.url );
15+
this.pushed_at = this._parsePushedDate( this.pushed_at );
1716

1817
return $(
1918
"<div class='github-box'>" +
@@ -44,11 +43,6 @@ GithubRepo.prototype._parsePushedDate = function ( pushed_at ) {
4443
return date.getDate() + "/" + ( date.getMonth() + 1 ) + "/" + date.getFullYear();
4544
};
4645

47-
// Parses URL to be friendly
48-
GithubRepo.prototype._parseURL = function ( url ) {
49-
return url.replace( "api.", "" ).replace( "repos/", "" );
50-
};
51-
5246
// -- Github Plugin ------------------------------------------------------------
5347

5448
function Github( element, options ) {

0 commit comments

Comments
 (0)