Neil deGrasse Tyson quotes API: The Daily REST library entry for Excel and GAScript

Random Neil deGrasse Tyson quotes

There’s probably no practical use to today’s API of the day, except that I am always amused by what he has to say. The other thing I wanted to look at was a slightly more complex usage of the restQuery capability, but at the same time to talk a little more about how this exposed interface could benefit from using jSon arguments rather than the traditional list imposed on us by VBA syntax.

As usual it is implemented as a rest-library member. This a single query API, populating a single row on each call, and with no query arguments. It will populate a spreadsheet row (Excel or Google Docs) for each quote received up to a maximum specified.You just name the columns to match any data you want to retrieve and go. Here’s an example of 10 random quotes in a Google Spreadsheet.

The rest library is itself implemented as REST API and can be queried like this.

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

Now when we take a look at the code this time, you will see the many optional arguments exposed by this function. In a future post I’ll demonstrate how to use jSon formatted arguments in both GAS and VBA to improve the usability of complex functions like these.

Gist for library entry

Loading ….
About brucemcp 223 Articles
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time. The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it. I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


two + three =