May 6th, 2013
If you’ve visited the promo page for Big Bucket’s upcoming game, Space Age, you’ll notice that it’s possible to add your email address to our mailing list. To manage this mailing list, I’m using Campaign Monitor.
Here’s a Panel I wrote that displays the number of people who have subscribed to a Campaign Monitor list.
The solution consists of 3 parts:
- A Ruby script that accesses the Campaign Monitor API.
- A Launch Agent that periodically runs that Ruby script.
- Some HTML/JS for presenting the output of that script in Status Board.
First, install the
sudo gem install createsend
~/Dropbox/Public/statusboard. And ensure that the script is executable:
chmod +x ~/Dropbox/Public/statusboard/campaignmonitor.rb
The Launch Agent
You’ll need to configure the LaunchAgent/Script to point to your particular Campaign Monitor list, so open
com.bigbucketsoftware.campaignmonitor.plist in your favorite text editor and replace
API KEY GOES HERE with your Campaign Monitor API key and
LIST ID GOES HERE with your ID of the list you want to track. You’ll also need to replace occurrences of
USERNAME with your username.
To find your API key, log into Campaign Monitor and click Account Settings. To find a List’s ID, navigate to that list and click change name/type.
Hooking It All Up
Now it’s time to run the Launch Agent. From the
launchctl load com.bigbucketsoftware.campaignmonitor.plist launchctl start com.bigbucketsoftware.campaignmonitor
Assuming that worked, the file
campaignmonitor.txt should have appeared in
~/Dropbox/Public/statusboard. If it didn’t you may want to try opening
Console.app and looking for clues.
Finally, you can add your new Panel to Status Board! From Finder, right-click
~/Dropbox/Public/statusboard/campaignmonitor.html and click
Dropbox > Get Public Link. Once you’ve got that URL on your iPad, (by emailing it, iMessaging it, or just type it out really, really carefully,) open Status Board, drag a Do-It-Yourself panel onto the board, and point it to your URL. Good luck!