Browse Source

Fix tweets; updates.

master
Ben Kurtovic 11 years ago
parent
commit
dabea92f53
4 changed files with 25 additions and 69 deletions
  1. +0
    -1
      _layouts/base.html
  2. +15
    -18
      _layouts/home.html
  3. +10
    -6
      css/main.css
  4. +0
    -44
      js/tweets.js

+ 0
- 1
_layouts/base.html View File

@@ -6,7 +6,6 @@
<link rel="stylesheet" href="/css/main.css" type="text/css" />
<link rel="stylesheet" href="/css/syntax.css" type="text/css" /> <!-- shamelessly stolen from https://github.com/mojombo/tpw/blob/master/css/syntax.css -->
<script src="/js/date_format.js" type="text/javascript"></script>
<script src="/js/tweets.js" type="text/javascript"></script>
</head>
<body onload="load_tweets();">
<div id="forkme-box">


+ 15
- 18
_layouts/home.html View File

@@ -27,24 +27,20 @@ layout: base
<td class="about-r light-r"><a href="http://en.wikipedia.org/wiki/User:The_Earwig">[[User:The Earwig]]</a></td>
</tr>
<tr>
<td class="about-l dark-l">Toolserver</td>
<td class="about-r dark-r"><a href="http://toolserver.org/~earwig">~earwig</a></td>
<td class="about-l dark-l">GitHub</td>
<td class="about-r dark-r"><a href="http://github.com/earwig">earwig</a></td>
</tr>
<tr>
<td class="about-l light-l">GitHub</td>
<td class="about-r light-r"><a href="http://github.com/earwig">earwig</a></td>
<td class="about-l light-l">BitBucket</td>
<td class="about-r light-r"><a href="https://bitbucket.org/earwig">earwig</a></td>
</tr>
<tr>
<td class="about-l dark-l">BitBucket</td>
<td class="about-r dark-r"><a href="https://bitbucket.org/earwig">earwig</a></td>
<td class="about-l dark-l">Twitter</td>
<td class="about-r dark-r"><a href="http://twitter.com/the_earwig">@the_earwig</a></td>
</tr>
<tr>
<td class="about-l light-l">Twitter</td>
<td class="about-r light-r"><a href="http://twitter.com/the_earwig">@the_earwig</a></td>
</tr>
<tr>
<td id="about-bl" class="about-l dark-l">Tumblr</td>
<td id="about-br" class="about-r dark-r"><a href="http://theearwig.tumblr.com/">theearwig</a></td>
<td id="about-bl" class="about-l light-l">Tumblr</td>
<td id="about-br" class="about-r light-r"><a href="http://theearwig.tumblr.com/">theearwig</a></td>
</tr>
</table>
<h2 class="index-header">Projects</h2>
@@ -55,18 +51,19 @@ layout: base
<div id="avatar-box">
<img id="avatar" src="https://secure.gravatar.com/avatar/1b21804852ac50fee9f8e03cfa0da786?s=140" title="Earwig" alt="Earwig" />
</div>
<p id="about-me-top">I'm Ben Kurtovic, a student, software developer, and <a href="http://en.wikipedia.org/">Wikipedian</a> who occasionally messes around with game production. I'm the guy behind <a href="http://en.wikipedia.org/wiki/User:EarwigBot">EarwigBot</a>. I love <a href="http://en.wikipedia.org/wiki/My_Little_Pony%3A_Friendship_Is_Magic">ponies</a>!</p>
<p id="about-me-top">I'm Ben Kurtovic, a student, software developer, and <a href="http://en.wikipedia.org/">Wikipedian</a> who occasionally messes around with game production. I'm the guy behind <a href="https://github.com/earwig/mwparserfromhell">mwparserfromhell</a> and <a href="http://en.wikipedia.org/wiki/User:EarwigBot">EarwigBot</a>.</p>
<p>On this page, you can find my identities on a few other sites, check out the projects I'm working on, and read some of my incessant ramblings in blog form.</p>
<h2 class="index-header">Tweets</h2>
<ul id="tweets">
<li><a href="http://twitter.com/the_earwig">More...</a></li>
</ul>
<h2 class="index-header">Posts</h2>
<ul>
<ul id="post-list">
{% for post in site.posts %}
<li class="post">{{ post.date | date: "%b %d, %Y" }}: <a class="invert" href="{{ post.url }}">{{ post.title }}</a><br /><span class="description">{{ post.description }} (<a href="{{ post.url }}#disqus_thread" data-disqus-identifier="{{ post.id }}"></a>)</span></li>
{% endfor %}
</ul>
<h2 class="index-header"><a class="incognito" href="https://twitter.com/the_earwig">Tweets</a></h2>
<div id="follow-button-box"><a href="https://twitter.com/the_earwig" class="twitter-follow-button" data-show-count="false" data-dnt="true">Follow @the_earwig</a>
<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>
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/the_earwig" data-widget-id="392426863047364608" data-chrome="noheader" data-tweet-limit="5">Tweets by @the_earwig</a>
<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>
</td>
</tr>
</table>


+ 10
- 6
css/main.css View File

@@ -22,10 +22,6 @@ body {
font-size: 12px;
}

.tweet {
color: #888;
}

.index-header {
padding-top: 15px;
text-align: center;
@@ -64,7 +60,7 @@ div.project-body {
padding: 6px 12px 9px 12px;
border-radius: 0px 0px 5px 5px;

background: #F4F4F4;
background: #F4F4F4;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F9F9F9), to(#EFEFEF));
background: -webkit-linear-gradient(top, #F9F9F9, #EFEFEF);
background: -moz-linear-gradient(top, #F9F9F9, #EFEFEF);
@@ -167,13 +163,21 @@ div#avatar-box {
background-color: #FFF;
border: 1px solid #999;
border-radius: 5px;
-webkit-transform:rotate(3deg);
-moz-transform:rotate(3deg);
-o-transform:rotate(3deg);
-ms-transform:rotate(3deg);
}

div#follow-button-box {
float: right;
}

ul#post-list {
padding-left: 1em;
}

img#forkme {
position: absolute;
top: 0;


+ 0
- 44
js/tweets.js View File

@@ -1,44 +0,0 @@
function load_tweets() {
var element = document.getElementById("tweets");
if (element) {
var callback = "like_a_boss";
var username = "the_earwig";
var count = 4;
var url = "https://twitter.com/statuses/user_timeline/" + username + ".json?count=" + count + "&callback=" + callback;

var script = document.createElement("script");
var head = document.getElementsByTagName("head")[0];

window[callback] = function(tweets) {
head.removeChild(script);
show_tweets(tweets, element);
};

script.src = url;
head.appendChild(script);
}
}

function show_tweets(tweets, element) {
var addedHTML = "";
for (t in tweets) {
var tweet = tweets[t];
var t = '<li class="post">' + fmt_text(tweet["text"]) + "<br />";
t += '<a href="http://twitter.com/' + tweet["user"]["screen_name"] + '/status/' + tweet["id_str"] + '">'
t += '<span class="tweet description">' + fmt_date(tweet["created_at"]) + "</span>";
t += "</a></li>";
addedHTML += t;
}
element.innerHTML = addedHTML + element.innerHTML;
}

function fmt_text(t) {
t = t.replace(/(http:\/\/.*?(\s|$))/ig, '<a href="$1">$1</a>$2');
t = t.replace(/\@(.*?)(\s|$)/ig, '<a href="http://twitter.com/$1">@$1</a>$2');
t = t.replace(/\#(.*?)(\s|$)/ig, '<a href="http://twitter.com/search/%23$1">#$1</a>$2');
return t;
}

function fmt_date(d) {
return dateFormat(d, "ddd, mmm d, yyyy 'at' h:MM TT");
}

Loading…
Cancel
Save