forked from jmillerinc/blackbirdpy
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the JavaScript and CSS that work with Blackbird.py to style t…
…he embedded tweet.
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This script requires jQuery. | ||
$(document).ready(function() { | ||
styleTweets(); | ||
}); | ||
|
||
function styleTweets() { | ||
$(".bbpBox").each( function(i) { | ||
var divID = $(this).attr("id"); | ||
var tweetID = divID.slice(1); | ||
var tweetURL = 'http://api.twitter.com/1/statuses/show/' + tweetID + '.json?callback=?'; | ||
$.getJSON(tweetURL, function(data){ | ||
var twDate = new Date(data.created_at); | ||
var shortdate = twDate.toDateString(); | ||
$("#" + divID).css('background', 'url(' + data.user.profile_background_image_url + ') #' + data.user.profile_background_color); | ||
$("#" + divID + " .twMeta").css('display', 'none'); | ||
content = $("#" + divID + " .twContent").append('<p class="twDate"><a href="http://twitter.com/' + data.user.screen_name + '/' + tweetID + '">' + shortdate + '</a></p><p class="twAuthor"><a href="http://twitter.com/' + data.user.screen_name + '"><img src="' + data.user.profile_image_url + '" /></a><a href="http://twitter.com/' + data.user.screen_name + '"><strong>@' + data.user.screen_name + '</strong></a><br /><span class="realName">' + data.user.name + '</span></span></p>' ); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#content .bbpBox { | ||
width: 75%; | ||
background: #F3FEF3; | ||
margin-left: auto; | ||
margin-right: auto; | ||
padding: 1em; | ||
} | ||
|
||
#content .bbpBox blockquote { | ||
font-size: 110%; | ||
background-color: white; | ||
margin: 0em !important; | ||
padding: .5em 1em .5em 1em; | ||
-moz-border-radius: 5px; | ||
-webkit-border-radius: 5px | ||
} | ||
|
||
#content .bbpBox blockquote a { | ||
color: blue; | ||
text-decoration: none; | ||
} | ||
|
||
#content .bbpBox blockquote a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
#content .bbpBox blockquote .twMeta { | ||
font-size: 80%; | ||
} | ||
|
||
#content .bbpBox blockquote .twAuthor { | ||
font-family: Sans-serif; | ||
font-size: 80%; | ||
color: #aaa; | ||
margin-top: 0em; | ||
padding-top: .75em; | ||
border-top: solid 1px #aaa; | ||
} | ||
|
||
#content .bbpBox blockquote .twDate { | ||
font-family: Sans-serif; | ||
font-size: 60%; | ||
text-align: right; | ||
} | ||
|
||
#content .bbpBox blockquote .twAuthor img { | ||
float: left; | ||
margin-right: .5em; | ||
height: 2.5em; | ||
} |