Publishing and sharing web site content
Publishing information on your web site can be a liberating experience. It is powerful to write content and share it directly on your site for your visitors to digest. Depending on your content and marketing strategy, this may be enough.
But let’s say you have a specific need to share content directly with partner sites or another application. One way would be to copy the content and publish it on the other site. That might work at first, but what happens when your content changes? It gets out of sync in a hurry if it isn’t managed properly. This can be a frustrating experience over time, and also can lead to sites being out of date and no longer relevant. Even if you do take the steps to keep it up to date, you are touching the information twice each time, and that costs valuable time and money. What’s the solution?
Keep your data in sync
When two partnering web sites need to share information on demand, creating an Application Programming Interface (API) may be the right solution. An API can assist web sites and applications with sharing data, which can help to integrate and enhance the functionality of the applications.
In this example, I’ll share with you what we did to automatically provide information from three different web sites for display on another local organization web site, Positively Allegan. Source sites include: Allegan Area Arts Council, Allegan Area Chamber of Commerce and the Regent Theatre.
Source web site – prepping the data for external use
The Allegan Area Arts Council is a member-based organization that displays a unique page of information about each member on its web site. All of this information is created, updated and managed using WordPress. The web site pulls the specific data elements from the database and displays it on the web site. This is all public information and, since it is stored in a database, we can access it and re-purpose it to solve specific business cases. We wrote a custom API to extract public member data from the database and expose it using a unique URL that creates a text-based output dataset. The data is in JSON format so it is highly portable.
Target web site – accessing the data and formatting the display
Now that the data we need has been made available to outside applications, we can retrieve that dataset and use it to display member data on the target site, Positively Allegan. We wrote a small web service that retrieves this dataset and formats the elements for display on the web site. Every time the source API is accessed, we get images for four Arts Council members and the URL to link back to their member page on the source web site. We are using page caching on the Positively Allegan site about every four hours so that this information is refreshed. This enhances the member benefits for the Allegan Area Arts Council. It also reduces the management cost of updating this data to zero. So every four hours or so, the data automatically gets updated and nobody has to touch it.
Allegan Area Chamber of Commerce
As you can see in the above screenshot, the right side of the screen displays community connections from Allegan Area Chamber of Commerce. We are running the same procedure on their member based web site. We created a source API to provide data to the target site, Positively Allegan. From there the Positively Allegan site grabs the dynamic dataset and formats it for display. Each member of the chamber site has a logo and contact information. In this case the API provides different data based on the use case for the chamber.
The weekly movie at the Regent Theatre is automatically displayed on the homepage of Positively Allegan. This is another great use case for an API. We simply pull the current movie from the homepage of the Regent site and then display it on the homepage of the events section on the Positively Allegan web site. This way, it is always accurate and nobody has to update it. When the movie changes on the Regent site, it also changes on the Positively Allegan site.