Skip to content

Commit

Permalink
Use GitHub events feed
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquez committed Nov 19, 2013
1 parent 5472849 commit 8e349d5
Show file tree
Hide file tree
Showing 5 changed files with 875 additions and 109 deletions.
Binary file added assets/octicons.ttf
Binary file not shown.
17 changes: 9 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>Mike Enriquez - Software Developer</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css"/>
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<link rel="stylesheet" href="stylesheets/octicons.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/jquery.sound.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/application.js" type="text/javascript" charset="utf-8"></script>
Expand All @@ -16,15 +17,15 @@
<div id="container">
<div id="nav-bar">
<ul id="nav">
<li><a href="http://blog.enriquez.me">Blog</a></li>
<li><a href="http://twitter.com/enriquez">Twitter</a></li>
<li><a href="http://github.com/enriquez">GitHub</a></li>
<li><a href="http://twitter.com/enriquez">Twitter</a></li>
<li><a href="http://blog.enriquez.me">Blog</a></li>
</ul>
</div>
<div id="content">
<div class="info" id="blog">
<h2><a href="http://blog.enriquez.me">http://blog.enriquez.me</a></h2>
<div id="posts"></div>
<div class="info" id="github">
<h2><a href="http://github.com/enriquez">http://github.com/enriquez</a></h2>
<div id="events"></div>
</div>
<div class="info" id="twitter">
<h2><a href="http://twitter.com/enriquez">http://twitter.com/enriquez</a></h2>
Expand All @@ -33,9 +34,9 @@ <h2><a href="http://twitter.com/enriquez">http://twitter.com/enriquez</a></h2>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
<div class="info" id="github">
<h2><a href="http://github.com/enriquez">http://github.com/enriquez</a></h2>
<div id="projects"></div>
<div class="info" id="blog">
<h2><a href="http://blog.enriquez.me">http://blog.enriquez.me</a></h2>
<div id="posts"></div>
</div>
</div>
<img id="me" src="images/me.png" width="292" height="330" alt="Me"/>
Expand Down
32 changes: 7 additions & 25 deletions javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ RSSFeed.Entries = function(feed_url, callback){
});
}

// GitHub API wrapper. http://developer.github.com/
function GitHubAPI(){}

// http://developer.github.com/v3/repos/
GitHubAPI.Repos = function(username, callback){
requestURL = "https://api.github.com/users/" + username + "/repos?callback=?";
$.getJSON(requestURL, function(json, status){
callback(json.data.reverse(), status);
});
}

$(document).ready(function(){
$(".info").hide();
$("ul#nav a").click(function() {
Expand All @@ -38,13 +27,10 @@ $(document).ready(function(){
$(".info:visible").slideUp(100);
$(this).addClass('active');
$("#" + $(this).text().toLowerCase()).animate({opacity:1},100).slideDown(250, function() {
console.log($("#twitter:visible iframe").contents().find(".h-feed").height());
$("#twitter:visible iframe").height($("#twitter:visible iframe").contents().find(".h-feed").height() + 50);
});
}

// $("#twitter:visible iframe").css({height: $("#twitter iframe").scrollHeight()});

return false;
});

Expand All @@ -69,18 +55,14 @@ $(document).ready(function(){
$("#blog div#posts").html(content);
})

GitHubAPI.Repos("enriquez", function(json, status){
RSSFeed.Entries("http://github.com/enriquez.atom", function(json, status){
var content = "";
$.each(json, function(i){
projectName = "<a href=\"" + this.url + "\">" + this.name + "</a>";
projectDescription = this.description;
stats = this.watchers + " watchers";
if (this.forks > 0){
stats += ", " + this.forks + " forks";
}
content += "<p class=\"project\">" + projectName + " <span class=\"date\">" + stats + "</span><br/>" + projectDescription + "</p>";
});
$("#github #projects").html(content);
})
event_type = "something";
event = "<div class=\"alert\"><div class=\"body\">" + this.description +"</div></div>";
content += event;
})

$("#github #events").html(content);
})
});
Loading

0 comments on commit 8e349d5

Please sign in to comment.