Skip to content

Instantly share code, notes, and snippets.

@g-r-a-v-e-l-y
Created May 27, 2013 15:56
Show Gist options
  • Save g-r-a-v-e-l-y/5657772 to your computer and use it in GitHub Desktop.
Save g-r-a-v-e-l-y/5657772 to your computer and use it in GitHub Desktop.
A very silly full screen "most recent tweet" gag.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Devops Wisdom</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
function GetLastTweet(UserName) {
url = 'http://api.twitter.com/1/statuses/user_timeline/' + UserName + '.json?callback=?';
$.getJSON(url, function (tweet) {
$("#tweet").html(tweet[0].text);
});
}
function GetProfileImage(UserName) {
url = 'http://api.twitter.com/1/statuses/user_timeline/' + UserName + '.json?callback=?';
$.getJSON(url, function (image) {
$("#ProfileImage").attr('src', image[0].user.profile_image_url);
});
}
</script>
<style>
h1{
font-size: 5em;
font-family: Pragmata, Menlo, 'DejaVu LGC Sans Mono', 'DejaVu Sans Mono', Consolas, 'Everson Mono', 'Lucida Console', 'Andale Mono', 'Nimbus Mono L', 'Liberation Mono', FreeMono, 'Osaka Monospaced', Courier, 'New Courier', monospace;
}
img{
position: fixed;
top: 1em;
left: 1em;
}
#tweet{
position: fixed;
top: -.5em;
left: 4.5em;
}
</style>
</head>
<body onload="GetLastTweet('devops_borat'); GetProfileImage('devops_borat')">
<img id="ProfileImage" />
<h1 id ="tweet">
</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment