Microsoft Facebook SDK now officially supported

The Microsoft SDK for Facebook Platform has reached version 3.0 and is now officially supported by the Facebook Development Team. The team recently announced this on their dev-blog, which is great news for all .NET developers wanting to develop applications against the Facebook Platform.

..This SDK contains rich social features and offers something for almost any kind of Facebook developer who is building with Microsoft technology, whether you’re implementing Facebook Connect or are building a Web-based or desktop application…

Microsoft has also supplied a great SDK Overview that will get you started with facebook development in technologies like Silverlight, WinForms, WebForms /ASP.Net, ASP.Net MVC. There are several examples along with the documentation that should be more than sufficient to get the ball rolling.

Share your url to Twitter

twitter logo

So, you’ve written that great article, you’ve shared it to your friends on facebook, and you’re looking to spread the word even further. Through Twittter, your url can reach entire diffrent audiences than Facebook sharing. Getting those first few important re-tweets on Twitter will start to spread your new blogpost like wildfire.

If Twitter is still a great mystery to you, I’d recommend Scott Hanselman’s introduction to twitter. You may also be interested in reading Twitter’s own brief “about us” page.

Time to get our hands dirty

It’s extremely simple to send an update to twitter using their public share url like so:

http://twitter.com/home?status=Currently reading http://pavsaund.wordpress.com/2009/11/04/share-your-url-to-twitter-share

So now you know how to do it, there’s no reason not to just add a tweet this icon! tweet this

Sharing links to Facebook

sharetofacebook

Need to spread the word on your latest blog-post or article? Look no further than the Facebook sharer! Facebook has over 300 million users world-wide, and the chances are good that you can recruit readers. Adding a “share to facebook” icon easily allows your readers to spread YOUR word. This can be accomplished by using plugins for your blog-service, or “share-all” widgets like AddThis or ShareThis. The problem with these services, are that they over-complicate the simple share functionality that’s often wanted. That’s where implementing specefic Facebook-share functionality comes in very handy.

The Facebook sharer

Facebook has a large development community that uses its extensive API to publish applications, and advanced Facebook features on their sites. The simplest way to spread the word is the basic facebook sharer-url.

http://www.facebook.com/sharer.php?

By visiting the facebook-sharer page, you can get code to copy/paste into your site to enable sharing fast and simple. All you need to do is choose the desired look of your link, and copy the accompanying code-snippet.

Facebook provides 4 options here:

  • fbshare_icon
  • fbshare_text
  • fbshare_icontext
  • fbshare_javascript

Linking to the sharer

The sharer accepts 2 parameters when passing in the URL to share. Remember that each variable has to be encoded. Refer to the script provided by Facebook for the exact code for this.

  • u=
  • t=

This would give the following url

http://www.facebook.com/sharer.php?u=http://pavsaund.wordpress.com/2009/10/22/sharing-links-to-facebook/&t=Sharing links to Facebook

Help the sharer with !

The sharer-bot does a crawl of the url sent in, and extracts the title, page content and relevant images. The bot does this based on it’s own algorithm, and usually this works just fine. The problem occurs when you share a page filled with content and images that may confuse the bot. In these cases, the bot may share the wrong picture or unrelated content.

If you want to control exactly what’s shared then you need to include the following meta tags in your page’s head.

This way, you control exactly what the reader shares from your page. Consider also adding your blog-info in the content, as this rarely gets picked up by the bot (since this is reserved for the end of an article or a separate page)

A few things to keep in mind

The meta names title and description have to be lowercased for the bot to pick them up. Other wise it seemingly ignores them.

The facebook sharer states that when using meta tags, the minimum tags to include are title and description, otherwise metatags are ignored.

Beware when sharing sites with dynamic content linked to a static url. Facebook caches all pages it crawls and may store this cache for several weeks. This may also cause problems for sites with dynamic url, as it seems Facebook my have old DNS lookups cached.

Rounding up..

I hope this post is of some value to you. Feedback is always welcome!