Skip to content

Instantly share code, notes, and snippets.

@danmartin
Forked from kevinold/simple-twitter-timeline.html
Last active December 20, 2015 20:28
Show Gist options
  • Save danmartin/6190396 to your computer and use it in GitHub Desktop.
Save danmartin/6190396 to your computer and use it in GitHub Desktop.
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Twitter widget</title>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../../css/main.css">
<script src="../../js/angular-1.0.0rc10.min.js"></script>
<script type="text/javascript">
function twitter_controller($scope, $http) {
var twitter_api_url = "http://api.twitter.com/1/statuses/user_timeline.json"
, username = "danmartin70"
, config = {
params : {
screen_name: username
, callback : "JSON_CALLBACK"
, include_rts : true
, count: 5
, clientsource : "TWITTERINC_WIDGET"
, "1340767850386": "cachebus"
}
};
$http.jsonp( twitter_api_url, config ).success(
function(data, status, headers, config){
$scope.tweets = data;
}
);
}
twitter_controller.$inject = ['$scope', '$http'];
</script>
</head>
<body class="demo">
<section ng-app>
<div id="twitter-feed" ng-controller="twitter_controller">
<ol>
<li ng-repeat="tweet in tweets">
{{ tweet.text }}
</li>
</ol>
</div>
</section>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment