At the Forge - OpenSocial and Google Gadgets
The past few months, I've written about the Facebook API, which allows third-party developers to integrate their applications into Facebook. A large number of such applications exist already, and more are being created and released every day.
However, Facebook isn't the only social-networking site out there. Indeed, Facebook isn't even the largest social-networking site—although it is the fastest-growing and seems to have a great deal of momentum. This is due in no small part to developers' ability to create and integrate new applications into Facebook. And, although most Facebook applications are (I think) pretty silly, that hasn't stopped people from trying them and even using them on a regular basis.
Facebook's offer of a developer API definitely was a good thing for Facebook users. But, it was bad news for at least three other groups of people. First, users of other social-networking systems suddenly were faced with the prospect of using a less-popular system. (In the world of social networking, a less-popular system also is less desirable.) Second, the people running non-Facebook social-networking sites, such as LinkedIn and MySpace, suddenly were faced with the prospect of their users leaving for Facebook. Finally, software developers began to look at Facebook as the most-desirable platform for which they should develop, because it had the largest user base. Even if one or more of the competing sites were to unveil an API, and even if it were as rich as the Facebook API, it probably wouldn't reach enough users to make the doubled effort worthwhile.
So, I was fascinated to learn, via Marc Andreessen's blog, that a number of social-networking sites were responding to Facebook in a way that satisfied all three of these populations. They announced an API that would allow an application to work across many different social-networking sites. This API, known as OpenSocial, can be added to any site (“container”) or application. If you write a Facebook application, it'll work only on Facebook. But, if you write an OpenSocial application, it'll work under Ning, MySpace, Orkut and nearly a dozen other systems.
Of course, OpenSocial isn't exactly the same as the Facebook API. And, in fact, it has some disadvantages when compared with the Facebook API. Also, as I write these words in mid-December 2007, OpenSocial still is stuck in an early beta release.
However, OpenSocial is interesting from a few perspectives. First, it's an interesting shot across Facebook's bow, and one that deserves our attention, if only because it demonstrates the lengths to which companies now will go to attract developers and users. But, it's also interesting because it's the first application standard I can think of that is based on HTTP, JavaScript and HTML. That is, I believe OpenSocial is the first Web development API that is completely client-side, rather than server-side. If nothing else, this shows how important JavaScript has become to Web developers.
This month, we start looking at OpenSocial from the perspective of an application developer. OpenSocial builds on work done at Google; thus, it's based on several technologies developed at Google, including Google Gadgets. So, let's begin our discussion of OpenSocial by looking at Google Gadgets and how we can create and use them. Next month, we'll look at how to turn a simple gadget into a social gadget and connect it with OpenSocial containers.
An OpenSocial application is, at heart, a combination of XML and JavaScript, using a special version of Google Gadgets. The code is written in JavaScript, and preferences and guidelines for the gadget are set using XML. The simplest possible gadget, taken from Google's on-line documentation, is the following:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hello world" />
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
The above gadget, as you can imagine, doesn't do very much. The first line shows that it's an XML document and that it's encoded using UTF-8. This means we can write gadgets in any language we like, and they should work correctly. The gadget is then contained inside <Module> tags, apparently because gadgets were called modules when they were under development. The content of a gadget sits inside a <Module>.
There are three potential sections inside a gadget:
ModulePrefs: defines the settings for a particular gadget.
Content: contains the HTML that is displayed for the user, as well as any JavaScript code with which the user will interact.
UserPrefs: used to store user preferences.
The above test gadget doesn't contain any UserPrefs, and its Content section contains only HTML, but it still is valid.
To see this gadget in action, you need to create an iGoogle page. This requires having a Google login. (I'm familiar with the privacy concerns that are increasingly raised about Google. OpenSocial will not be tied to Google; thus, it doesn't require a Google login. However, for the time being, it's easiest to create a gadget for an iGoogle page.) Go to your personal iGoogle page: google.com/ig.
On the right side of the screen is a link called Add stuff. This is how you add new gadgets to your personal iGoogle page. By default, it shows the most popular gadgets, and you're obviously welcome to add as many or as few of these gadgets as you want. However, if you're going to be developing gadgets, add the My Gadgets gadget, which gives you some additional control and functionality. Use the search box to find My gadgets, and when you find it in the search-result listing, click on the add it now link. You will be brought back to your iGoogle page, with this new gadget now available.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- A Topic for Discussion - Open Source Feature-Richness?
- Dart: a New Web Programming Experience
- What's the tweeting protocol?
- Developer Poll
- May 2013 Issue of Linux Journal: Raspberry Pi
- Reply to comment | Linux Journal
2 hours 14 min ago - Reply to comment | Linux Journal
3 hours 31 min ago - great post
4 hours 6 min ago - Google Docs
4 hours 29 min ago - Reply to comment | Linux Journal
9 hours 17 min ago - Reply to comment | Linux Journal
10 hours 4 min ago - Web Hosting IQ
11 hours 38 min ago - Thanks for taking the time to
13 hours 14 min ago - Linux is good
15 hours 12 min ago - Reply to comment | Linux Journal
15 hours 29 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




Comments
Hi
Thanks the article was really insightful