I made an API for symbol shortcuts

I was getting tired of googling it everytime I needed to know a shortcut to make a ™ or a ∞. So I turned it into an API via Kimonify. It took some work, because it wouldn’t let me combine the columns very well form this source page: http://fsymbols.com/keyboard/mac/

I ended up making two difference collections in the API, one for each side of the split table on the website. And annoyingly I had to use different keys for the second collection. Then I used Kimonos’ javascript editor to modify the results before they are returned, in order to merge the two tables together. I’ll paste the script I used for that below.

I might want to eventually turn this into a mac app. The widghet I wanted to embed here to show it off is not working because wordpress blocks iframes, unfortunately. So check out the json results here: http://www.kimonolabs.com/api/atgaoiai

[EDIT: Since KimonoLabs was acquired, the new url I have setup is: https://paul-kimono.firebaseio.com//kimono/api/atgaoiai/latest.json]

Modification javascript to turn two collections into one collection with matching keys.

function transform(data) {
 var collection2 = data.results.collection2
 for (var row in collection2) {
   var object = collection2[row]
   object.Key = object.Key2
   object.Option = object.Option2
   object.OptionShift = object.OptionShift2
   delete object.Key2
   delete object.Option2
   delete object.OptionShift2
   data.results.collection1.push(object)
 }
   delete data.results.collection2
   return data;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s