Skip to content

Commit 9cbb62f

Browse files
author
dksimpson
committed
Fix code indenting
1 parent b41be14 commit 9cbb62f

File tree

6 files changed

+52
-52
lines changed

6 files changed

+52
-52
lines changed

articles/cognitive-services/Bing-Video-Search/quickstarts/csharp.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515

@@ -22,7 +22,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
2222
## Prerequisites
2323
* Any edition of [Visual Studio 2017 or later](https://www.visualstudio.com/downloads/).
2424
* The [Json.NET](https://www.newtonsoft.com/json) framework, available as a NuGet package.
25-
* If you're using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
25+
* If you're using Linux/MacOS, you can run this application by using [Mono](https://www.mono-project.com/).
2626

2727
[!INCLUDE [cognitive-services-bing-video-search-signup-requirements](../../../../includes/cognitive-services-bing-video-search-signup-requirements.md)]
2828

@@ -38,7 +38,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
3838
using System.Collections.Generic;
3939
```
4040

41-
2. Add variables for your subscription key, endpoint, and search term. You can use the value of `uriBase` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
41+
2. Add variables for your subscription key, endpoint, and search term. For the `uriBase` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4242

4343
```csharp
4444
const string accessKey = "enter your key here";
@@ -50,13 +50,13 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
5050

5151
Define a `SearchResult` struct to contain the image search results, and JSON header information.
5252

53-
```csharp
54-
struct SearchResult
55-
{
56-
public String jsonResult;
57-
public Dictionary<String, String> relevantHeaders;
58-
}
59-
```
53+
```csharp
54+
struct SearchResult
55+
{
56+
public String jsonResult;
57+
public Dictionary<String, String> relevantHeaders;
58+
}
59+
```
6060

6161
## Create and handle a video search request
6262

articles/cognitive-services/Bing-Video-Search/quickstarts/java.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515
# Quickstart: Search for videos using the Bing Video Search REST API and Java
@@ -56,7 +56,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
5656
}
5757
```
5858

59-
3. Create a new method named `SearchVideos()` with variables for your API endpoint host and path, your subscription key, and search term. This method returns a `SearchResults` object. You can use the value of `host` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
59+
3. Create a new method named `SearchVideos()` with variables for your API endpoint host and path, your subscription key, and search term. This method returns a `SearchResults` object. For the `host` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
6060

6161
```java
6262
public static SearchResults SearchVideos (String searchQuery) throws Exception {
@@ -71,7 +71,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
7171

7272
In the `SearchVideos()` method, perform the following steps:
7373

74-
1. Construct the URL for your request by combining your API host, path, and encoded search query. Then, use `openConnection()` to create a connection, and add your subscription key to the `Ocp-Apim-Subscription-Key` header.
74+
1. Construct the URL for your request by combining your API host, path, and encoded search query. Use `openConnection()` to create a connection, and then add your subscription key to the `Ocp-Apim-Subscription-Key` header.
7575

7676
```java
7777
URL url = new URL(host + path + "?q=" + URLEncoder.encode(searchQuery, "UTF-8"));
@@ -105,15 +105,15 @@ In the `SearchVideos()` method, perform the following steps:
105105

106106
Create a method named `prettify()` to format the response returned from the Bing Video API. Use the Gson library's `JsonParser` to convert a JSON string to an object. Then, use `GsonBuilder()` and `toJson()` to create the formatted string.
107107
108-
```java
109-
// pretty-printer for JSON; uses GSON parser to parse and re-serialize
110-
public static String prettify(String json_text) {
111-
JsonParser parser = new JsonParser();
112-
JsonObject json = parser.parse(json_text).getAsJsonObject();
113-
Gson gson = new GsonBuilder().setPrettyPrinting().create();
114-
return gson.toJson(json);
115-
}
116-
```
108+
```java
109+
// pretty-printer for JSON; uses GSON parser to parse and re-serialize
110+
public static String prettify(String json_text) {
111+
JsonParser parser = new JsonParser();
112+
JsonObject json = parser.parse(json_text).getAsJsonObject();
113+
Gson gson = new GsonBuilder().setPrettyPrinting().create();
114+
return gson.toJson(json);
115+
}
116+
```
117117
118118
## Send the request and print the response
119119

articles/cognitive-services/Bing-Video-Search/quickstarts/nodejs.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515
# Quickstart: Search for videos using the Bing Video Search REST API and Node.js
@@ -35,7 +35,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
3535
let https = require('https');
3636
```
3737

38-
2. Create variables for your API endpoint, subscription key, and search term. You can use the value of `host` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
38+
2. Create variables for your API endpoint, subscription key, and search term. For the `host` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3939

4040
```javascript
4141
let subscriptionKey = 'enter key here';
@@ -57,7 +57,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
5757
};
5858
```
5959

60-
1. In this function, use `response.on()` when `end` is signaled to store the bing-related headers (beginning with `bingapis` or `x-msedge-`). Parse the JSON using `JSON.parse()`, convert it to a string with `JSON.stringify()`, and print it.
60+
1. In this function, use `response.on()` when `end` is signaled to store the bing-related headers (starting with `bingapis` or `x-msedge-`). Parse the JSON using `JSON.parse()`, convert it to a string with `JSON.stringify()`, and print it.
6161

6262
```javascript
6363
response.on('end', function () {
@@ -75,21 +75,22 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
7575

7676
Create a function called `bing_video_search()`. Add the parameters for your request including your host name, and headers. Encode your search term and append it to your path parameter with the `?q=` parameter. Then, send the request with `req.end()`.
7777

78-
```javascript
79-
let bing_video_search = function (search_term) {
80-
console.log('Searching videos for: ' + term);
81-
let request_params = {
82-
method : 'GET',
83-
hostname : host,
84-
path : path + '?q=' + encodeURIComponent(search_term),
85-
headers : {
86-
'Ocp-Apim-Subscription-Key' : subscriptionKey,
87-
}
88-
};
89-
let req = https.request(request_params, response_handler);
90-
req.end();
91-
}
92-
```
78+
```javascript
79+
let bing_video_search = function (search_term) {
80+
console.log('Searching videos for: ' + term);
81+
let request_params = {
82+
method : 'GET',
83+
hostname : host,
84+
path : path + '?q=' + encodeURIComponent(search_term),
85+
headers : {
86+
'Ocp-Apim-Subscription-Key' : subscriptionKey,
87+
}
88+
};
89+
let req = https.request(request_params,
90+
response_handler);
91+
req.end();
92+
}
93+
```
9394

9495
## JSON response
9596

articles/cognitive-services/Bing-Video-Search/quickstarts/php.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515

1616
# Quickstart: Search for videos using the Bing Video Search REST API and PHP
1717

18-
Use this quickstart to make your first call to the Bing Video Search API. This simple JavaScript application sends an HTTP video search query to the API, and displays the JSON response.
18+
Use this quickstart to make your first call to the Bing Video Search API. This simple PHP application sends an HTTP video search query to the API, and displays the JSON response. The example code is written to work under PHP 5.6.
1919

20-
Although this application is written in JavaScript and uses Node.js, the API is a RESTful Web service compatible with most programming languages.
21-
The example code is written to work under PHP 5.6.
20+
Although this application is written in PHP, the API is a RESTful Web service compatible with most programming languages.
2221

2322
## Prerequisites
2423

@@ -33,7 +32,7 @@ The [Bing Video Search API](https://docs.microsoft.com/rest/api/cognitiveservice
3332
1. Enable secure HTTP support in your `php.ini` file by uncommenting the `;extension=php_openssl.dll` line, as described in the following code.
3433
2. Create a new PHP project in your favorite IDE or editor.
3534
3. Add the code provided below.
36-
4. Replace the `$accessKey` value with an access key valid for your subscription. You can use the value of `$endpoint` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
35+
4. Replace the `$accessKey` value with an access key valid for your subscription. For the `$endpoint` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3736
5. Run the program.
3837

3938
```php

articles/cognitive-services/Bing-Video-Search/quickstarts/python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515

@@ -38,7 +38,7 @@ You can run this example as a Jupyter notebook on [MyBinder](https://mybinder.or
3838
import requests
3939
from IPython.display import HTML
4040
```
41-
2. Create variables for your subscription key, search endpoint, and search term. You can use the value of `search_url` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
41+
2. Create variables for your subscription key, search endpoint, and search term. For the `search_url` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4242

4343
```python
4444
subscription_key = None

articles/cognitive-services/Bing-Video-Search/quickstarts/ruby.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-video-search
1111
ms.topic: quickstart
12-
ms.date: 05/19/2020
12+
ms.date: 05/22/2020
1313
ms.author: aahi
1414
---
1515

@@ -35,7 +35,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
3535
require 'json'
3636
```
3737

38-
2. Create variables for the API endpoint, video API search path, your subscription key, and search term. You can use the value of `uri` in the following code for the global endpoint, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
38+
2. Create variables for the API endpoint, video API search path, your subscription key, and search term. For the `url` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3939

4040
```ruby
4141
uri = "https://api.cognitive.microsoft.com"
@@ -71,9 +71,9 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
7171

7272
After the response is received, print the JSON response.
7373

74-
```ruby
75-
puts JSON::pretty_generate(JSON(response.body))
76-
```
74+
```ruby
75+
puts JSON::pretty_generate(JSON(response.body))
76+
```
7777

7878
## JSON response
7979

0 commit comments

Comments
 (0)