Skip to content

Commit 74df1ee

Browse files
expand samples section
1 parent 71ae98b commit 74df1ee

22 files changed

+94
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ In the following examples, you may need a `CLIENT_ID`, `CLIENT_SECRET` and
138138
For more information about OAuth2 and how it works, [see here][oauth].
139139

140140
A complete sample application that authorizes and authenticates with the OAuth2
141-
client is available at [`examples/oauth2.js`][oauthexample].
141+
client is available at [`samples/oauth2.js`][oauthexample].
142142

143143
##### Generating an authentication URL
144144

@@ -296,7 +296,7 @@ jwtClient.authorize(function(err, tokens) {
296296
});
297297
```
298298

299-
The parameters for the JWT auth client including how to use it with a `.pem` file are explained in [examples/jwt.js](examples/jwt.js)
299+
The parameters for the JWT auth client including how to use it with a `.pem` file are explained in [samples/jwt.js](samples/jwt.js)
300300

301301
#### Choosing the correct credential type automatically
302302

@@ -391,7 +391,7 @@ drive.files.insert({
391391
```
392392

393393
For more examples of creation and modification requests with media attachments,
394-
take a look at the `examples/mediaupload.js` sample.
394+
take a look at the `samples/mediaupload.js` sample.
395395

396396
### Exposing request object
397397

@@ -508,7 +508,7 @@ See [CONTRIBUTING][contributing].
508508
[overflowimg]: https://googledrive.com/host/0ByfSjdPVs9MZbkhjeUhMYzRTeEE/stackoveflow-tag.png
509509
[devconsole]: https://console.developer.google.com
510510
[oauth]: https://developers.google.com/accounts/docs/OAuth2
511-
[oauthexample]: https://github.com/google/google-api-nodejs-client/tree/master/examples/oauth2.js
511+
[oauthexample]: https://github.com/google/google-api-nodejs-client/tree/master/samples/oauth2.js
512512
[options]: https://github.com/google/google-api-nodejs-client/tree/master#options
513513
[gcloud]: https://github.com/GoogleCloudPlatform/gcloud-node
514514
[gcloudapis]: https://googlecloudplatform.github.io/gcloud-node/#/docs/gcloud

samples/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Samples by API
2+
3+
The following samples show basic usage of various APIs.
4+
5+
## ![](http://www.google.com/images/icons/product/analytics-32.png) Google Analytics API
6+
7+
View and manage your Google Analytics data.
8+
9+
Documentation for the Google Analytics API in
10+
[JSDoc](http://google.github.io/google-api-nodejs-client/2.1.7/analytics.html).
11+
12+
<table>
13+
<tr>
14+
<td><a href="analytics">samples/analytics</a></td>
15+
<td>Command-line samples for producing reports with the Analytics API</td>
16+
</tr>
17+
</table>
18+
19+
## ![](https://www.google.com/images/icons/product/compute_engine-32.png) Google Compute Engine Metadata API
20+
21+
Lets you set key/value pairs using the GCE metadata service.
22+
23+
Documentation for the Google Compute Engine Metadata API in
24+
[JSDoc](http://google.github.io/google-api-nodejs-client/2.1.7/compute.html).
25+
26+
<table>
27+
<tr>
28+
<td><a href="coordinate">samples/compute</a></td>
29+
<td>Demonstrates how to use the Google Compute Engine Metadata API</td>
30+
</tr>
31+
</table>
32+
33+
## ![](http://www.google.com/images/icons/product/customsearch-32.png) CustomSearch API
34+
35+
Lets you search over a website or collection of websites.
36+
37+
Documentation for the CustomSearch API in
38+
[JSDoc](http://google.github.io/google-api-nodejs-client/2.1.7/customsearch.html).
39+
40+
<table>
41+
<tr>
42+
<td><a href="customsearch">samples/customsearch</a></td>
43+
<td>Search from the command-line</td>
44+
</tr>
45+
</table>
46+
47+
## ![](http://www.google.com/images/icons/product/shortlinks-32.png) URL Shortener API
48+
49+
Lets you create, inspect, and manage `goo.gl` short URLs.
50+
51+
Documentation for the URL Shortener API in
52+
[JSDoc](http://google.github.io/google-api-nodejs-client/2.1.7/urlshortener.html).
53+
54+
<table>
55+
<tr>
56+
<td><a href="urlshortener">samples/urlshortener</a></td>
57+
<td>Shortens a URL with the URL Shortener API</td>
58+
</tr>
59+
</table>

samples/analytics/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Analytics Samples
2+
3+
The Google Analytics API lets you collect, configure, and analyze your data to reach the right audience.
4+
5+
[Getting Started](https://developers.google.com/analytics/)
6+
7+
## Running the sample
8+
9+
`node analytics.js`

examples/analyticswrite.js renamed to samples/analytics/analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
var google = require('../lib/googleapis.js');
17+
var google = require('../../lib/googleapis.js');
1818
var analytics = google.analytics('v3');
1919
var OAuth2Client = google.auth.OAuth2;
2020

samples/compute/README.md

Whitespace-only changes.

examples/compute.js renamed to samples/compute/compute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
var request = require('request');
18-
var google = require('../lib/googleapis.js');
18+
var google = require('../../lib/googleapis.js');
1919
var compute = google.compute('v1');
2020
var uri = 'http://metadata/computeMetadata/v1/project/project-id';
2121
var headers = { 'Metadata-Flavor': 'Google' };

samples/customsearch/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Custom Search API Samples
2+
3+
Google Custom Search enables you to create a search engine for your website, your blog, or a collection of websites.
4+
5+
[Getting Started](https://developers.google.com/custom-search/)
6+
7+
## Running the sample
8+
9+
`node customsearch.js`

examples/customsearch.js renamed to samples/customsearch/customsearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
var google = require('../lib/googleapis.js');
16+
var google = require('../../lib/googleapis.js');
1717
var customsearch = google.customsearch('v1');
1818

1919
// You can get a custom search engine id at
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)