Wednesday, February 16, 2011

Add twitter feed to your website (without plugin or leading username)

start with script

<script 
 src="http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js" 
 type="text/javascript">
</script>
<script type="text/javascript" charset="utf-8">
getTwitters('tweet', { 
  id: 'rem', 
  count: 1, 
  enableLinks: true, 
  ignoreReplies: true, 
  clearContents: true,
  template: '"%text%" <a href="http://twitter.com/%user_screen_name%/statuses/%id_str%/">%time%</a>'
});
</script>

And then insert the html to insert

<div id="tweet">
 <p>Please wait while my tweets load <img src="/images/indicator.gif" /></p>
 <p><a href="http://twitter.com/rem">If you can't wait - check out what I've been twittering</a></p>
</div>

you can custom this with css for example:
.twitters {
font-family:Arial;
  padding: 1px;
  font-size:92%;
   line-height:140%;
  overflow: hidden;
  width: 270px;
  color:#292e56;
  font-weight:bold;
}
.twitters a:hover{text-decoration:underline;}
.twitters ul {
  list-style: none;
  padding: 0;
  white-space: nowrap;
    color:#292e56;
  font-weight:bold;
}

.twitters span.prefix {
  font-weight: bold;
    color:#292e56;
}

.twitters span.time {
  font-style: italic;
  color:#292e56;
  font-weight:bold;
}

.twitters span.status {
  font-style: italic;
  color:#292e56;
  font-weight:bold;
}

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Web Design & Marketing - Click and get an instant quote on your project