3rd party API Abstraction

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
stakes
Forum Commoner
Posts: 48
Joined: Tue Jun 12, 2007 12:05 pm

3rd party API Abstraction

Post by stakes »

Recently I've been looking into building some kind of "mash up" web application. The easiest thing would be to stick with one provider like Google, and build the application for example on top of the Google app engine SDK, but my target audience are primarily not Google users but mostly Facebook, Windows Live (Msn) and Yahoo users, and I don't want to handle any user credentials like passwords, or storing user data like photos or blog entries, but to rely on external services only.

So in theory what I want to do is to build a social network API abstraction class in PHP. The main goals of the application would be to provide authentication against 3:rd party website (similar to openID) but also to access the different photo services that each provider has (Yahoo has Flickr, Facebook has it's own, Google has Picassa.. and so forth) and perhaps also somewhere to store blog entries. You could then use this on any of your own web applications providing a single interface that talks to several API's depending on what site the user already has an account on. On the event of a user belonging to several networks, the user would have to chose which provider to use as authentication provider.

There are some existing ideas trying to solve the issue like OAuth, and Googles Open Social but they are very limited in what they can do, and have only support for a handful of API providers. As of designing the actual application I would want to build something that would be very easy to extend for other people by just adding additional files into the class directory. So something like:

socialAbstraction_core.php
socialAbstraction_facebook.php
socialAbstraction_someOtherAPIProvider.php

This is all in my head right now and this is the first time i took time and wrote down what I'm actually trying to do. So would be nice with feedback on the idea, any obvious pitfalls? is it doable? Am I out of my mind? :) Does something like this already exist?

(ps. I wasn't sure where to post this since it's not really PHP related, but the idea is to eventually build the application with PHP)
Last edited by stakes on Mon Jul 28, 2008 2:21 pm, edited 1 time in total.
User avatar
VirtuosiMedia
Forum Contributor
Posts: 133
Joined: Thu Jun 12, 2008 6:16 pm

Re: 3rd party API Abstraction

Post by VirtuosiMedia »

I like the idea. As a first step, I'd take a look at all the different APIs you want to interact with, make a list of their calls, and see what they have in common. I'd be interested to see that as well. A good place to get the info might be http://www.programmableweb.com/apis.
Post Reply