Thursday, October 7, 2010

Share your Blog / Website articles in facebook, twitter, linkedIn, buzz

Some quick ways to create buttons for your website/blog and share your articles on buzzing social networking.

Copy and paste the following codes in single.php in your wordpress theme.
1. Official Tweet Button:
goto twitter.com -> Goodies -> tweet button
make necessary settings and copy the generated code in you single.php

Something Similar link gets generated:
<a class="twitter-share-button" data-count="none" data-via="shrutijakhete" href="http://twitter.com/share">Tweet New</a><script src="http://platform.twitter.com/widgets.js" type="text/javascript">
</script>

2. Facebook like button:
Facebook like button can be integrated in two ways.
1. Iframe
2. Javascript Version

Iframe is the easiest way to put like button whereas javascript version allows you customize your settings. Thanks to hyperarts.com they have explained javascript version is explained here quite well.

Using Iframe:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px;"></iframe>

3.LinkedIn:
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php wp_title();?>" target="_blank"><img src="http://static03.linkedin.com/img/pic/pic_logo_119x32.png" border=0 alt="Share on LinkedIn" title="LinkedIn"  height="20px"></a>

4. Buzz:
<a class="google-buzz-button" data-button-style="small-count" data-locale="en_IN" href="http://www.google.com/buzz/post" title="Post to Google Buzz"></a><script src="http://www.google.com/buzz/api/button.js" type="text/javascript">
</script>

Reference:
1. http://www.developer.facebook.com
2. http://www.twitter.facebook.com
3. http://www.developer.linkedIn.com

Wednesday, February 3, 2010

swfObject


swfObject is the small javascript library (10Kb / GZIPed: 3.9Kb), used to embed flash content  in your html page.
Major Advantages:
1.       1.  It detects if the browser has flash player to play the flash content.
2.      2.  It detect flash player version.
3.       3. Can be helpful to display an alternative content if your browser does not have flash player installed in it.
4.       4. SEO optimization of flash content.
5.       5. Better way around for <embed> tag which is not w3c valid tag.

How to Use?
1.       Download the library.
2.       Add it in your app.
<script type="text/javascript" src="swfobject.js"></script>
3.       Add some container in your html page which could hold the flash content.
e.g. <div id=”flashContent”>&nbsp;</div>
4.    <script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>

What each parameter means:
var so = new SWFObject(swf, id, width, height, version, background-color);

Related Links: