Skip to content

Commit

Permalink
beginnings of a twitter feed
Browse files Browse the repository at this point in the history
  • Loading branch information
cmelbye committed Aug 18, 2009
1 parent 4f52154 commit 623dc7f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 21 deletions.
42 changes: 29 additions & 13 deletions _layouts/default.html
Expand Up @@ -5,27 +5,29 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{{ page.title }}</title>
<meta name="author" content="Charles Melbye" />
<meta name="author" content="Charlie Melbye" />

<!-- syntax highlighting CSS -->
<link rel="stylesheet" href="/css/syntax.css" type="text/css" />
<link rel="stylesheet" href="css/syntax.css" type="text/css" />

<!-- Homepage CSS -->
<link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {

// GitHub Repo Listing
var limit = 5 // how many repos to list
var login = 'cmelbye' // your username
var github_login = 'cmelbye' // your username

var repos = [], list = $('ul#repos')
var repos = [], repo_list = $('ul#repos')

if( list.length > 0 ) {
list.empty();
if( repo_list.length > 0 ) {
repo_list.empty();

$.getJSON('http://github.com/api/v1/json/' + login + '?callback=?', function(data) {
$.getJSON('http://github.com/api/v1/json/' + github_login + '?callback=?', function(data) {
$.each(data.user.repositories, function() {
// This is kind of ugly, but then again, so is having your GitHub
// Pages repository be in your repo list.
Expand All @@ -37,18 +39,32 @@
})

$.each(repos.slice(0, limit), function() {
list.append('<li><a href="' + this.url + '">' + this.name + ':</a> ' + this.description + '</li>');
repo_list.append('<li><a href="' + this.url + '">' + this.name + ':</a> ' + this.description + '</li>');
})
})
}

// Twitter
var tweets = 5
var twitter_login = 'cmelbye'

var tweets = [], tweet_list = $('ul#tweets')

if( tweet_list.length > 0 ) {
tweet_list.empty();

$.getJSON('http://twitter.com/statuses/user_timeline/' + twitter_login + '.json?count=' + tweets + '&callback=?', function(data) {
window.console.log(data);
})
}
})
</script>
</head>
<body>

<div class="site">
<div class="title">
<a href="/">Charles Melbye</a>
<a href="/">Charlie Melbye</a>
<a class="extra" href="/">home</a>
<a class="extra" href="http://github.com/cmelbye">repos</a>
</div>
Expand All @@ -58,16 +74,16 @@
<div class="footer">
<div class="contact">
<p>
Charles Melbye<br />
Founder of <a href="http://yourwiki.net/">YourWiki</a><br />
Charlie Melbye<br />
<a href="http://yourwiki.net/">YourWiki</a><br />
charlie@yourwiki.net
</p>
</div>
<div class="contact">
<p>
<a href="http://github.com/cmelbye/">github.com/cmelbye</a><br />
<a href="http://twitter.com/cmelbye/">twitter.com/cmelbye</a><br />
<a href="http://github.com/cmelbye/cmelbye.github.com/">View Source</a>
<a href="http://github.com/cmelbye/cmelbye.github.com/">View Source</a>
</p>
</div>
<div class="contact">
Expand Down
20 changes: 19 additions & 1 deletion css/screen.css
Expand Up @@ -56,7 +56,25 @@ table {
/* Home
/*
/*****************************************************************************/


div#blog_columns:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

div#column_one {
float: left;
width: 45%;
}

div#column_two {
float: right;
width: 45%;
}

ul.posts {
list-style-type: none;
margin-bottom: 2em;
Expand Down
28 changes: 21 additions & 7 deletions index.html
@@ -1,15 +1,27 @@
---
layout: default
title: Charles Melbye
title: Charlie Melbye
---

<div id="home">
<h1 id="blog_posts">Blog Posts</h1>
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>

<div id="blog_columns">
<div id="column_one" class="column">
<h1 id="twitter_tweets">Tweets</h1>
<ul class="tweets" id="tweets">

</ul>
</div>

<div id="column_two" class="column">
<h1 id="blog_posts">Blog Posts</h1>
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div>
</div>

<h1 id="projects">Projects</h1>
<ul class="posts">
Expand All @@ -24,6 +36,8 @@ <h1 id="github_repos">GitHub Repos</h1>

<h1 id="friends">Friends on GitHub</h1>
<ul class="posts">
<li><a href="http://github.com/martinbrandenburg">Martin Brandenburg</a></li>
<li><a href="http://tsion.github.com/">Scott Olson</a></li>
<li><a href="http://github.com/robbiet480">Robbie Trencheny</a></li>
</ul>
</div>

0 comments on commit 623dc7f

Please sign in to comment.