Shorten URL API directly into an Excel or Google Spreadsheet
Today’s API is from “ttb.li” which is a url shortening service. This is a query by row API, populating columns in a spreadsheet row using a value in a given column. Here’s an example – you supply a list of long urls. It will give you back shortened versions.
Here’s the Excel code (included in cDataSet.xlsm downloadable from the ramblings site)
Public Sub testUrlShorten() generalDataSetQuery "url shorten", "url shorten", "longurl" End Sub
and the GAS version (included in a Google Spreadsheet) using the mcpher GAS library
function testUrlShorten() { mcpher.generalDataSetQuery ("url shorten", "url shorten", "longurl"); }
The rest library is itself implemented as REST API and can be queried like this.
Or better yet, shorten the url using the api above and get the whole thing with http://ttb.li/se5cm
For more stuff like this, visit the ramblings site or the associated blog. If you have suggestion for particular API or contact me on our forum