One thing I don’t like about the AddThis API is that it doesn’t give you the ability to get all services to make your own custom visualizations. You can only make a bookmark URL one link at a time. If there was some way to get all the services listed you could loop through them in any programming language and make your own organized listing of all the services and attach the link accordingly. Whether that was a just a scroll box or some kind of crazy over-the-top 3D Flash thing it would be possible with such an API. I suggested this idea of a Supported Services Data API on the AddThis forum. You can see the post here.
I have a feature request that I’m sure at least a lot of people in the Flash community would like to have. It would be great if there was a way to access all the service names posted here.
In addition to the service names, it would be necessary to have access to the service thumbnail image URLs and service descriptions though a data API similar to Twitter’s search API. Basically, the developer would send a request to a URL and the URL would return either XML or JSON or some other standard data language. This would enable Flash developers (and all other web developers) to create data driven custom visualizations for the AddThis bookmark repertoire. Thanks for your support.
The moderator told me that they were working on a Flash API and lead me to believe that this new API would be able to get the supported services. The API did not address anything that I was looking for, it only added OExchange support, whatever that is, but no way of getting the names and codes of the 150+ services that they have available.
It doesn’t seem like they have any plans of making a Supported Services Data API so I hacked out my own. I made a class that goes on to AddThis and screen scrapes the needed information to make visualizations for Flash. This is achieved by loading in 3 files from the AddThis site. Firstly, the class loads the services HTML page and parses all the data from the services table, then it parses a CSS file to get all the y locations of the PNG sprite images and finally it loads the PNG sprite image. With the information provided in this class you would be able to make any kind of visualization you could think of. Here is my simple example of what the class is capable of. You can download the Flex Builder files here.
Here are my disclaimers about this class. It is firstly a hack. These webpages can change at any time and it may cause the class to break. I know that some people might build something with this class and then have the data source be broken, so I included files that absolutely work with this class in the data folder of the Flex Builder example. If worse comes to worse you will always have at least some list of data to pull from.
Secondly, this was done more as a proof-of-concept that perhaps that I could show to AddThis to show what interesting kinds of things could be done with a Supported Services API. It’s not what I would call a production worthy class.
Lastly, and my least favorite caveat is that you need to write server side proxy files to get the data. You have to do this because AddThis does not have a crossdomain.xml so Flash cannot load things from that domain. In the Flex example I wrote some proxy files in PHP. You can see they are very simple, but it still another step and three more files that I would rather not have to make this class work. Also, be aware that you probably need to change the server location in the init function from a dot to your web address where you are hosting the proxy files.