RSS Automation with TLCPL Digital Collections
Too Long : Didn’t Read; (TL:DR;)
If you follow these steps you’ll be able to build an RSS Feed from ContentDM and with that RSS Feed use an If This Then That service like Zapier to push out images to social media platforms without knowing how to code.
- Github Repository
- Edit the .CSV file
- Edit Lines
- 12 (optional)
- 13 (optional)
- Put on any server running PHP
- Create Zapier “Zap”
- Relax because you can automate things like a boss
Time is the most precious resource we have. On the 3rd floor of the Toledo Lucas County Public Library’s (TLCPL) Main Library, there is a digitization department constantly preserving and archiving the history of Toledo, Lucas County, and Northwest Ohio. These images appear in an online repository called ContentDM which the Library uses through Ohio Memory. The Local History Department wanted to share collections, but time was on limited supply. Their primary role is to digitize, not necessarily market what is being digitized. John Dewees the head of the digitization department at TLCPL developed a process to share these images with little impact on staff, but a major impact on our community. John would create a CSV file (like a local database) and we would use PHP to determine the date and push out the description, image, and URL to Twitter and potentially other social media platforms.
So why use a CSV? Well a database requires someone with IT knowledge to build. A CSV is created inside a basic spreadsheet software program like Excel. If we can build the application so it is accessible to more people, then more people can create and iterate on this idea for their collections.
|Date||CDM# Metadata||CDM# Image|
The date field is extremely important. This is what allows us to work way ahead. By using the date field we can plan out for a year or more what images we want to publish.
The original idea was to create a twitterbot. We had done a twitterbot before for new materials. It worked – but was not overall deemed successful. We lacked the ability to push images to Twitter. The lack of images proved to be a big deterrent from the very visual Twitter platform. While in the process of modifying code and making the images work with the Twitter API, John had brought up the idea of RSS and using an IFTTT (If This Then That) tool. It was brilliant.
We used the ContentDM APIs and IIIF (International Image Interoperability Framework). I do need to give credit to Phil Sager at Ohio Memory. He helped a ton with examples of how to use the API and IIIF. Let’s dive into the process.
You will first want to download the GitHub repo for ContentDM RSS Feeds. It sounds scary, but if you choose to download as zip files, it’ll feel like downloading any other zip files.
Step 1: Minor Code Changes
There are only a few important code modifications. You can make these changes in any plain text editor.
#1 Renaming our CSV
Type in the csv file name you will be using.
#2 To bit.ly or not to bit.ly
We are fortunate enough to have a bit.ly brand account. We linked a domain to our bit.ly account to help promote brand consistency. You will need to decide if you are using bit.ly or not. If you have a bit.ly account you will want to leave this in. If you do not have a bit.ly account you can follow the steps below to remove it.
Keep bit.ly line 86:
You won’t need to make any modifications here. The application is setup to use bit.ly by default.
$bitlycdmlink = get_bitly_short_url($cdmlink,$login,$appkey);
Remove bit.ly line 86:
You will want to comment out line 86 or delete it. You can comment by adding two forward slashes: //
//$bitlycdmlink = get_bitly_short_url($cdmlink,$login,$appkey);
On line 89, you will want to remove the two forward slashes: //
$bitlycdmlink = $cdmlink;
If you are removing bit.ly then also remove this at the top of the .php file.
#3 Updating to your ContentDM Collection
The last code change you need to make is the contentDM collection number, server address, and base URL. For TLCPL it is Ohio Memory, but for most CDM customers it will be an OCLC url.
This is the final step. After typing in the new information you are done with all of the coding edits.
Step 2: Really Simple Syndication (RSS)
The backbone to success is RSS.
This is what our RSS feed will look like. You can use a tool to validate your RSS Feed. The only step here is to validate our RSS before we try to use it.
Step 3: If This Then That (IFTTT)
So what do we do now that we have a killer RSS Feed? We take it to Zapier that’s what! Zapier is an “If This Then That” service. We will be using it to say:
- IF there is a new item in the RSS Feed
- THEN post the image, description, and link to Twitter.
You can also do other fancy things like sending all new Tweets to buffer which allows you to post on Instagram and in turn Facebook. We won’t cover those today, but it is fully possible.
So what’s next.
You’ll want to click the big orange button on every page that says “Make a New Zap” and search for the integration from RSS to Twitter – “Post RSS feed items as Twitter image posts“. You can see exactly how it will look just above in the screen shot.
Once you have that you will follow the prompts, connecting to your RSS Feed and your Twitter account. When building your Twitter message, make sure to preview and test it. That way you can see if before it goes live.
After you finish this step, it will tell you your Zap is live and ready to go. Sit back and relax while this automation takes place. The only piece you will ever need to update is the CSV file adding in more dates and numbers. This is a very little lift in terms of overall work and allows you to be proactive planning ahead.
The idea behind building an RSS Feed is that the data is able to be transformed into whatever we need. The process we used was Extract, Transform, and (now) Load, or ETL. The reason we didn’t just use the CDM API is that we can’t pull all the data at once with their APIs. So we use 2 calls using CDM and iiiF to get the data we need and transform it into a usable RSS Feed.
If you run into problems, let us know. If you create something amazing, let us know too!