-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
91 lines (74 loc) · 2.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!doctype html>
<head>
<meta charset="utf-8">
<title>ohs aggregator test</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<ol id="feed" class="socialitems l-grid">
</ol>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
<script src="js/jquery.masonry.min.js"></script>
<script src="js/jquery.imagesloaded.min.js"></script>
<script type="text/javascript">
$(function(){
var PIPE_URL = "http://pipes.yahoo.com/pipes/pipe.run?_id=9d9e40c2b0589de762a385e4312ce535&_render=json&numItems=15";
$.getJSON(PIPE_URL, function(data) {
var twitter_template = $("#twitter_template").html();
var facebook_template = $("#facebook_template").html();
var instagram_template = $("#instagram_template").html();
_.each(data.value.items,function(i){
i = _.extend(i, {
'date': new Date(i.pubDate)
});
switch(i.author){
case "twitter":
$("#feed").append(_.template(twitter_template,{i:i}));
break;
case "facebook":
$("#feed").append(_.template(facebook_template,{i:i}));
break;
case "instagram":
$("#feed").append(_.template(instagram_template,{i:i}));
break;
default:
}
});
var $container = $('#feed');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : '.socialitem',
isFitWidth: true
// columnWidth: 330
});
});
});
});
</script>
<script type="text/html" id='twitter_template'>
<li class="socialitem socialitem-twitter">
<h3 class="socialitem-title"><%= i.title %></h3>
<time datetime="<%= i.date.toISOString() %>" pubdate class="socialitem-publishdate">
<%= i.date.toDateString() %>
</time>
</li>
</script>
<script type="text/html" id='facebook_template'>
<li class="socialitem socialitem-facebook">
<h3 class="socialitem-title"><%= i.title %></h3>
<time datetime="<%= i.date.toISOString() %>" pubdate class="socialitem-publishdate">
<%= i.date.toDateString() %>
</time>
</li>
</script>
<script type="text/html" id='instagram_template'>
<li class="socialitem socialitem-instagram">
<img src="<%= i['media:content'].url %>" />
<h3 class="socialitem-title"><%= i.title %></h3>
<time datetime="<%= i.date.toISOString() %>" pubdate class="socialitem-publishdate">
<%= i.date.toDateString() %></time>
</li>
</script>
</body>
</html>