Home » Blackbird Pages » Documentation » Use Cases » Web Service Integration

Web Service Integration

[Graphics are coming soon]

PHP, being on of, if not the most, popular language running the internet means many popular web sites provide a way to integrate with their services using technology which is accessible to PHP. This is one of, if not the greatest advantages to Blackbird. For instance, lets say you run an Ebay Store and have a Google AdWords add which publicizes certain items in your store. However, you are getting low on a certain item, but paying a rather high cost-per-click for the link. With Blackbird, you can create a few processe, each of which perform the following functions:

  1. WarehouseMonitor - Monitor the stocks of each of your items
  2. eBayManager - Interfaces with the eBay API
  3. AdWordsManager - Interfaces with the Google AdWords API

Each of these processes is pretty straight forward, and their uses are, independently, long reaching and capable of standing alone with functionality. But, combined with Blackbird and the concept of an ESB, the following high-level functionality is capable with the addition of only a few lines of code to each process.

If the stocks of an item in your inventory fall below a threshold value (as monitored by the WarehouseManager), a message is sent out to /topic/items/quantity/low the the quantity of the item is low.

eBayManager listens for messages on /topic/items/*, and when it gets a warning that the quantity is low, it closes any auctions on the given item that do not yet have bids.

AdWordsManager listens for messages on /topic/items*, and when it gets a warning that the quantity is low, it changes the cost-per-click of your ad to $0.01, effectively removing it from google search hits.

This allows you to automatically manage your eBay store and your advertisements on your items by simply using message handling. And because of how simple this process is for removing the items, it is equally easy to extend this functionality to adding items and upping the cost per click.

If the stocks of an item in your inventory grow pas a threshold value (as monitored by the WarehouseManager), a message is sent out to /topic/items/quantity/high the the quantity of the item is high.

eBayManager listens for messages on /topic/items/*, and when it gets a notification that the quantity is high, it adds a set number of auctions to ebay or lists the item in a store.

AdWordsManager listens for messages on /topic/items*, and when it gets a notification that the quantity is high, it changes the cost-per-click of your ad to a higher value, adding to the search results your add will display in.

With that kind of functionality integrated, it become a simple exercise to further expand the automation of your system, and integrate into other spheres. Amazon, for example, has an API which allows you to fetch read only results for products and such. If you have an overstock of items, some of which you posted to amazon, you and you noticing a high level of sales in these items, and/or a high user rating for them, you can have an AmazonManager send a message to /topic/items/ratings, and set the eBayManager and AdWordsManager to post these items to eBay and increase the cost-per-click to your amazon store and create a new entry for your eBay store to play off the popularity of your item sales.

The possibilities are limited merely by how much support the APIs to other web services give, and how imaginative you can get with setting up event handling for your integration.

As a note on development, because Blackbird is based off of the Zend Framework, and the Zend Framework comes with pre-configured modules for very popular web service (Google, Amazon, Yahoo!, etc), developing Web Service Integration becomes a matting of including a single file in your process and writing a few lines of code to listen for a specific message. It becomes just that easy.



ITema - "Making IT Simple."