Sign in | Display Options

Client Library

Conversations tagged with 'client library'

FriendFeed
Rob Diana shared an item on Google Reader
May 25, 2010 3:16 PM - Sign in to comment - Link
Shared by mangini
OOOOHHHHHH! At last!
Today, we’re pleased to announce our new orkut Java client library!

If you’ve ever wanted to write desktop or mobile apps for orkut, this new open source Java library provides you with that opportunity. Using three-legged OAuth, you can get friends’ profile data, post and retrieve status and activity updates, read and write scraps, create and retrieve photo albums, and upload pictures. To get started, simply download the library, check out the included samples, and start coding.

With this new library, it’s easy to have an application up and running with just a few lines of code. The snippet below shows how to create a new photo album, share it with your friends, and upload new photos:

CreateAlbumTx createAlbum = albumsFactory.createAlbum(
"College Days", "The best days of my life!");
Album album = createAlbum.getAlbum();
albumsFactory.shareAlbumWithFriends(album);

byte[] photo = captureImage();
photosFactory.uploadPhoto(album, photo, ImageType.JPG, "My Best Buddies");

And it’s just as simple to reply to scraps from friends and to make friends with new scrappers:

GetScrapsTx scraps = scrapFactory.getSelfScraps();
for(int i = 0; i < scraps.getScrapCount(); ++i) {
ScrapEntry scrap = scraps.getScrap(i);
if(myFriends.contains(scrap.getFromUserId())) {
scrapFactory.replyToScrap(scrap, "hey, thanks for remembering me!");
} else {
scrapFactory.replyToScrap(scrap, "wanna be friends? [:)]");
friendsFactory.sendFriendRequest(scrap.getFromUserId());
}
}

As you develop your application, we’d love if you’d let us know what you create. We’re excited to see how you use this library to integrate orkut with other exciting products and technologies... and in fact, we already started! Take a look at our new orkut FotoScrapr app, which we built on Google App Engine using a slick Google Web Toolkit interface. If you like what you see, feel free to browse through the FotoScrapr source code.

And finally, if you’re not a Java developer, don’t worry. We’d be thrilled to work with you to port this library to other languages. Just reach out to us on the orkut developer forum.

So dive in and start coding – we can’t wait to see what you’re going to come up with!

By Prashant Tiwari and Sachin Shenoy, orkut team
FriendFeed
Cristi shared an item on Google Reader
May 7, 2010 11:38 AM - Sign in to comment - Link

dropboxDropbox, the free, web-based file backup service, has rolled out a new API that gives developers a way to access, edit and save any file in a user’s Dropbox account.

The Dropbox API works a bit like an Amazon S3 storage bucket except that you, not the application in question, have control over your uploaded files.

The Dropbox API uses familiar tools like JSON, OAuth and OpenID, so web developers can essentially offload their user’s storage needs to Dropbox. For users, the usual risks of tying your web app to a cloud storage mechanism are mitigated by the fact that Dropbox keeps a local copy on your hard drive.

While the potential for integration with web apps is very cool — imagine if all your Flickr uploads automatically synced to the Dropbox folder on your hard drive for an instant backup — the first place you’ll likely see the Dropbox API in action is on mobile devices.

Storage limitations and, in the case of the iPhone/iPad, Apple’s imposed restrictions, mean that it’s difficult to build mobile apps that can access local files, let alone read, write and sync.

That’s the basic problem the Dropbox API seeks to overcome — using the Dropbox API means there’s no need for local files on your mobile device and everything is automatically synced back to your PC. The only catch is that you need an internet connection for the syncing to work.

Dropbox has already worked with a number of developers to integrate the new API prior to the launch. For example, Air Sharing, GoodReader and QuickOffice can now tap into your Dropbox account to edit and sync your Dropbox files. The new API ships with client libraries in Objective-C (pretty much required for the iPhone/iPad), Python, Ruby and Java. To create an application you’ll need to register with Dropbox and then, once you have access, you can grab the client library of your choice and check out the online documentation.

See Also:

FriendFeed
LouCypher shared an item on Google Reader
March 22, 2010 9:51 PM - Sign in to comment - Link

Occasionally I write more geeky posts that I don’t expect all my readers to understand.  I’m going to start prefacing those with “Geeky:” so you can know to ignore them in the future.  This is obviously one of those, so if the title doesn’t make sense to you, I don’t blame you for skipping over it all.

I have started playing recently with Facebook’s new Open Source Javascript Client Libraries.  It has actually been quite fun to work with, in that they separate all the code out in a manner that’s easy to access, read, and understand how it works.  Also, if I ever choose, I can host the Javascript files themselves on my own servers and reduce that potential failure point were Facebook’s servers to go down. (granted, you’re still relying on the Facebook API for them to work fully)  I can also contribute to the source in the event I feel something might work better (via my own Github fork).

One problem I’ve come across with the new libraries is that they have simplified the Javascript session cookies so that rather than 5 or 6 separate cookies all getting set and needing to be parsed on the client in order to identify the authorized user, only one cookie is set, and can be parsed using simple URI string parsing functions. This is actually a bonus in that there is less work to be done to authorize the user.  However, it means any old server-side clients that parse those cookies the old way will also need to be modified.  If you don’t modify your server-side client library to recognize the new cookies, your libraries will not be able to authenticate or authorize the user properly.

I needed a solution for the server side that worked well with the new format.  The specific code I’m writing is in PHP so it made sense to go with Facebook’s default PHP libraries, and I created a version of facebook.php that worked with the new Javascript SDK.  To set it up is simple – just take this file, unzip it, and replace the facebook.php in your default PHP Facebook client library install with the one you just unzipped.

Unfortunately, the file isn’t backwards compatible, so you will need to choose between either the new Open Source Javascript SDK or the old Facebook Javascript Client libraries.  This is because if you use the new Javascript SDK when you log the user out it only deletes the new format of session cookie.  Your PHP Client Libraries will set the old format if you don’t replace them with the version above.

There may still be a way to make all this backwards compatible, but for my purposes I haven’t had need to look into it.  Also, I’ve only tested this for my own use-cases, so there may be bugs.  Please send me a patch if you find any bugs and I’ll update my own version of the file.  As soon as it’s possible hopefully we can get this into the Facebook version as well.  I’m going to also update the Github Wiki for the new Javascript SDK so others can benefit.

Let me know if anything needs to be updated.  You can download the zipped facebook.php file here.


Geeky: PHP Client Library That Works With the New Facebook Javascript SDK

- Rob Diana
FriendFeed
LouCypher shared an item on Google Reader
March 17, 2010 11:14 PM - Sign in to comment - Link

Cloud computing is big right now, but the sheer number of options, and the lack of interoperability, can be an issue for developers. Vendor lock-in reduces the options available to those working on cloud computing initiatives, while the variability between APIs inevitably leads to many hours spent pouring over documentation when comparing cloud service providers.

There are a number of projects that can reduce, or even eliminate, some of these problems by exposing the functionality of a number of cloud service providers through a consistent interface. Here is a list of 7 such projects.

  • DeltaCloud is a RehHat initiative that provides a REST API and user tools to manage EC2, RHEV-M, RackSpace and RimuHosting, with VMWare ESX and more coming soon.
  • libcloud is a pure python client library for interacting with many of the popular cloud server providers. The libcloud web pages lists support for 11 cloud services provides.
  • The Simple Cloud API brings cloud technologies to PHP and the PHPilosophy to the cloud, starting with common interfaces for File Storage Services, Document Storage Services and Simple Queue Services. The API page shows support for Amazon S3, Windows Azure Blob Storage and Nirvanix, with more to come.
  • jclouds is an open source framework that helps you get started in the cloud and reuse your java development skills. Jclouds support many clouds including Amazon, VMWare, Azure, and Rackspace.
  • The Dasein Cloud API provides an abstraction for applications that wish to be written independent of the clouds they are controlling.
  • OpenNebula is an open and flexible tool that fits into existing data center environments to build any type of Cloud deployment. OpenNebula 1.4 supports Xen, KVM and VMware virtualization platforms and on-demand access to Amazon EC2 and ElasticHosts Cloud providers. It also features new local and Cloud interfaces, such as libvirt, EC2 Query API and OGC OCCI API.
  • Cloudloop is a new open source Java API and command-line management tool for cloud storage. Unfortunately the cloudloop web site was hacked recently, but you can find more information with this post on TheServerSide.

Just as with the growth of these cloud APIs and platforms, there are more libraries and abstraction initiatives all the time. Feel free to share any others we missed in the comments.

Please choose your display preferences:

CLOSE [ X ]