-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
133 lines (133 loc) · 5.38 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!doctype html>
<html>
<head>
<title>TweetScroller</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="css/tweetscroller.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>TweetScroller</h1>
</div>
</div>
</div>
<div id="tweet-container" class="span12">
<div id="tweets"></div>
<script id="tweet-template" type="text/x-handlebars-template">
<div class="tweet">
<blockquote class="twitter-tweet">
<div class="vcard author">
<a class="screen-name url" href="https://twitter.com/{{user.screen_name}}">
<span class="avatar">
<img src="{{user.profile_image_url}}" class="photo">
</span>
<span class="fn">{{user.name}}</span>
</a>
<a class="nickname" href="https://twitter.com/{{user.screen_name}}"><span>@{{user.screen_name}}</span></a>
</div>
<div class="entry-content">
<p class="entry-title">{{text}}</p>
</div>
<div class="footer">
<a class="view-details" href="https://twitter.com/{{user.screen_name}}/status/{{id_str}}">{{created_at}}</a>
</div>
</blockquote>
</div>
</script>
</div>
<div class="row">
<div class="span6">
<h2>About</h2><br>
<p><a href="https://github.com/divshot/tweetscroller">TweetScroller</a> is a simple jQuery plugin written in CoffeeScript that allows you to pull a collection of your favorite tweets using Twitter API v1 and display them in a fancy scroller with Masonry. <b>Twitter API v1 is now deprecated. You'll need to use your own Twitter v1.1 proxy to use this plugin.</b></p>
<p>We created this for the <a href="http://divshot.com">Divshot</a> lander and decided to open source it.</p>
</div>
<div class="span6">
<h2>Dependencies</h2><br>
<ul>
<li><a href="http://handlebarsjs.com/">Handlebars</a></li>
<li><a href="http://momentjs.com/">Moment.js</a></li>
<li><a href="http://masonry.desandro.com/">Masonry</a></li>
<li><a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent</a></li>
</ul>
</div>
</div><br>
<div class="row">
<div class="span6">
<h2>Markup</h2><br>
<script src="https://gist.github.com/3758527.js?file=head.html"></script>
<script src="https://gist.github.com/3758527.js?file=markup-and-template.html"></script>
<script src="https://gist.github.com/3758527.js?file=footer.html"></script>
</div>
<div class="span6">
<h2>JavaScript</h2><br>
<script src="https://gist.github.com/3758527.js?file=tweet.js"></script>
<table class="table table-striped">
<thead>
<tr>
<th>Option</th>
<th>Default Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>'tweets.herokuapp.com?callback=?'</td>
<td>URL to your Twitter API proxy. Must return a JSON response.</td>
</tr>
<tr>
<td>tweet</td>
<td>'.tweet'</td>
<td>Individual tweet <div> class.</td>
</tr>
<tr>
<td>template</td>
<td>'#tweet-template'</td>
<td>Handlebars template selector.</td>
</tr>
<tr>
<td>height</td>
<td>600</td>
<td>Height of container (in pixels).</td>
</tr>
<tr>
<td>speed</td>
<td>30</td>
<td>Speed of scroller in milliseconds. 30-80ms recommended.</td>
</tr>
<tr>
<td>autoplay</td>
<td>false</td>
<td>True: Autoscroll. False: Scroll on hover.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="span12">
<h2>Proxy Example</h2><br>
<p>This example uses Node.js and <a href="https://github.com/passcod/mtwitter">mtwitter</a> to serve favorite tweets from the @divshot account. Tweets are cached for 1 hour. To generate your API key, visit <a href="https://dev.twitter.com/">Twitter Developers</a>.</p><br>
<script src="https://gist.github.com/fastdivision/7257449.js"></script>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="js/handlebars.js"></script>
<script src="js/moment.js"></script>
<script src="js/jquery.masonry.js"></script>
<script src="js/jquery.hoverIntent.js"></script>
<script src="js/jquery.tweetscroller.js"></script>
<script>
(function(){
$('#tweets').tweetscroller({
autoplay: true,
url: 'http://divshot-tweets.herokuapp.com/tweets?callback=?'
});
})(jQuery);
</script>
</body>
</html>