Saturday, 28 August 2010 12:06

2 Fun and Usable jQuery Social Code Snippets Featured

Written by Chris Jacoby

2_Fun_and_Usable_jQuery_Social_Code_Snippets_1Here are2 fun things you can do to enhance your website’s social section.


#1 – jQuery YouTube Plugin

This plugin for jQuery is called jYouTube and can fetch any YouTube video’s thumbnail.

CODE

<script src="/internet-marketing-blog/jquery.js"></script>
<script src="/internet-marketing-blog/jyoutube.js"></script>



<script>

// Getting video screenshot by YouTube video ID

$.jYoutube('rSUfWXcNAOw');



// Returns video thumbnail by YouTube video URL

$.jYoutube('http://www.youtube.com/watch?v=rSUfWXcNAOw', 'small');

</script>


/CODE

To view a fully working demo and get the sample code, click here!

2_Fun_and_Usable_jQuery_Social_Code_Snippets_2

#2 – jQuery Twitter Updates

Ever wanted your twitter tweets to display on your website without having much programming language knowledge? Well now you can! (Pause here a sec, this sounds like a darn infomercial!)

With the jTwitter jQuery plugin, you can now easily display your Twitter or another twitter feed’s tweets.

Here is a basic example on how to initiate the plugin in your script:

CODE

<script src="/internet-marketing-blog/jquery.js"></script>
<script src="/internet-marketing-blog/jquery.jtwitter.js"></script>


<script>
// Defaults to 5 latest posts
$.jTwitter('gofishcc', function(posts){
//Callback function with the user data
});
</script>


/CODE

You can also specify the number of posts you want to be fetched:

CODE

<script type="text/javascript" src="/internet-marketing-blog/jquery.js"></script>
<script src="/internet-marketing-blog/jquery.jtwitter.js"></script>


<script>
// Let get 10 posts instead of the default 5
$.jTwitter('gofishcc', 10, function(posts){
//Callback function with the user data
});

</script>

/CODE

 

This is really easy to implement and after changing you stylesheets a bit you can make it blend in perfectly with your current web site.

To view a fully working demo and an example, click here

So, what now? Nothing here for Facebook? To view my blog on how to add a facebook like button to your website, click here.

You can also add other facebook plugins, like a Facebook activity feed, Like box, Friends Pile and more…Check out Facebook’s Plugin Site here.

Last modified on Friday, 10 September 2010 06:47
Chris Jacoby

Chris Jacoby

Chris is an Information Systems Engineer who has great experience with the online web world. His strengths lie in website application development, user friendly website design and development, graphics design and website optimization. 

Nothing is impossible! ~Chris


E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Add comment



Call Us: +27 11 612 7460