Skip to content

Commit

Permalink
Add README.md for Apps Script snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyDiamondstein authored Dec 5, 2016
1 parent a394a3a commit 6f5d67b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions apps-script/snippets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Apps Script Code Snippets

The `youtube-data-api.gs` file in this directory contains code snippets that are generated
by the Data API code snippet tool at:
https://developers.google.com/youtube/v3/code_samples/code_snippets

You can use that tool to test different parameter values and to generate code samples with
those modified parameter values. The tool generates code for several other programming
languages as well.

Each function in the file demonstrates a particular use case for a particular API method.
For example, there are several different use cases for calling the `search.list()` method,
such as searching by keyword or searching for live events.

In addition to the use-case-specific functions, the file also contains some boilerplate code
that prints some data from an API response to the logging console. The print function is
currently designed just to show that each API response returns data and serves as a placeholder
for any function that would actually process an API response.

## Running these samples

To run these samples:

1. Create a spreadsheet in [Google Drive](https://spreadsheets.google.com).
2. Select **Tools > Script Editor** from the menu bar.
3. Paste this code into the script editor and save your file.
4. In the script, select **Resources > Advanced Google Services** and toggle the option for the
YouTube Data API to on.
5. Click the link to the Google Developers Console and enable the YouTube Data API for the project.
6. Go back to the script editor and click 'OK' to indicate that you have finished enabling advanced services.
7. Run the `Main` function in your script.
8. Select **View > Logs** to see the output from the script.

0 comments on commit 6f5d67b

Please sign in to comment.