Introducing socialmedia.js v1.1
1 minute read
If you work with the Facebook API a lot, you know how tedious it is to hunt down the right script for the Facebook SDK every time you want an API function in your app. I ran into this when I started building Facebook applications about six months ago.
Every file that uses the API needs the JavaScript snippet in its HTML, a channel file for cross-domain access, and the special div the SDK initialises into. Doing that over and over gets old, unless you have an MVC style app or your own templates to cut it down.
So I wrote socialmedia.js. It's a small JavaScript library that bundles what the Facebook SDK needs, and you add it to your HTML with a couple of script lines. It works with Facebook's built-in plugins like the Like button, Comments Box and Follow Button, and with functions like Share and Invite.
It can also send a tweet. I built it for myself with only the bits I needed and have used it for over six months. Next I want to add setup for the Twitter API and the Google Plus API.
It's open source under the MIT license. The current stable version, 1.1, has docs and examples, and you can download it from GitHub.
Comments and feedback are welcome.