Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,84 @@ ul li:hover {
max-height:250px;
}

.tweet-img{
float:left;
border:1px solid #dedede;
background:#f0f3fb;
margin:5px;
padding:10px;
}

.tweet-img img{
max-width:200px;
max-height:150px;
display:block;
}

.tweet-infos{
float:right;
width:20%;
text-align:center;
border:;
border:1px solid #dedede;
background:#f0f3fb;
margin:5px;
padding:20px 5px;
}

.tweet-infos > *{
display:block;
text-align:center;
}

.tweet-infos img{
display:block;
margin:0 auto 10px;
}

.tweet-infos a{
color:#222;
}

.tweet-content{
overflow:hidden;
padding:0 50px;
font-size:12pt;
}

.tweet-content a{
display:inline-block;
font-size:12pt;
color:#222;
padding:3px 8px;
background:#ccc;
border:1px solid #dedede;
text-decoration:none;
}

.tweet-content a:hover{
background:#fff;
}

.tweet-link{
clear:both;
text-align:center;
}

.tweet-link a{
display:inline-block;
padding:10px 50px;
background:#000;
color:#fff;
text-decoration:none;
text-transform:uppercase;
}

li:hover .tweet-img,
li:hover .tweet-infos{
background:#fff;
}

#linkage {
position:fixed;
top:0px;
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ <h2>Query 5: Last 3 Twitter posts using hastag #API with custom callback</h2>
<div id="example5"></div>
<h2>Query 6: Last 3 Twitter posts using hastag #API with custom date formatter</h2>
<div id="example6"></div>
<h2>Query 8: Posts with custom Html template</h2>
<div id="example8"></div>

<!-- moment.js only needed for Query 6 example -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion js/exampleUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ require(['twitter-fetcher'], function (fetcher) {

var config8 = {
"id": '502160051226681344',
"maxTweets": 3,
"dataOnly": true,
"customCallback": populateTpl
};
Expand All @@ -253,8 +254,8 @@ function populateTpl(tweets){
var tweetObject = tweets[i];
html += '<li>'
+ (tweetObject.image ? '<div class="tweet-img"><img src="'+tweetObject.image+'" /></div>' : '')
+ '<p class="tweet-content">' + tweetObject.tweet + '</p>'
+ '<p class="tweet-infos">Posted on the ' + tweetObject.time + ', by ' + tweetObject.author + '</p>'
+ '<p class="tweet-content">' + tweetObject.tweet + '</p>'
+ '<p class="tweet-link"><a href="' + tweetObject.permalinkURL + '">Link</a></p>'
+ '</li>';
}
Expand Down