Adding Web Share Widgets to Your Site

, , …,
Want to master JavaScript in a week? Buy Xah JavaScript Tutorial.

this page is work in progress. Old article is removed.

How to create sharing widget?

Cook Your Own Share Widget

it's easy to create your own sharking links. All the little icons you can pull. Most if not all these social networking sites have API that lets you submit sites, pretty much just like this: 〔http://somebookmark .com/submit?url=http://example.org/nice_article.html〕, though the URL after the question mark needs to be Percent encoded. 〔➤ JavaScript Encode URL, Escape String

Here's the raw HTML you need to cook you own. The following shows some examples.

icon https://twitter.com/favicon.ico https://twitter.com/share?_=1300906220374&count=none&text=yourPageTitle&url=http%3A%2F%2Aexample.com%2A&via=xah_lee icon http://www.facebook.com/favicon.ico http://www.facebook.com/sharer.php?u=example.com%2F icon http://reddit.com/favicon.ico http://reddit.com/submit?url=http%3A%2F%2Aexample.com%2A icon http://news.ycombinator.com/favicon.ico http://news.ycombinator.com/submitlink?u=http%3A%2F%2Aexample.com%2A icon http://delicious.com/favicon.ico http://delicious.com/save?url=http%3A%2F%2Aexample.com%2A icon http://stumbleupon.com/favicon.ico http://stumbleupon.com/submit?url=http%3A%2F%2Aexample.com%2A icon http://slashdot.org/favicon.ico http://slashdot.org/bookmark.pl?url=http%3A%2F%2Aexample.com%2A

also you can look at how Wikipedia did it. Here: http://en.wikinews.org/wiki/US_government_to_replace_color-coded_terror_alert_system


Should Your Site Have A Share Widget?

One decision i have to make is whether my site should have such share widgets. It might be just a temporary fad for teens. Blogs began with such a perception, but today they are important tool in communication with major world impact. Web syndication (RSS/Atom) had such a perception too, when it began in about 1997, but is today a widely used standard.

Majority of people who use the web probably do not use any of the social networking or blog or bookmark sites. But a minority, probably hundreds of millions, do. Having a link right there to let them talk about a article is convenient. So, from a tool point of view, it is really good to have such a share widget. A important benefit for the web site owner is that it certainly does increase your traffic, when your article is discussed about in some site.

blog comments powered by Disqus