Skip to content

Commit cf0c2f7

Browse files
author
dksimpson
committed
Edits
1 parent 4116c9e commit cf0c2f7

File tree

7 files changed

+32
-33
lines changed

7 files changed

+32
-33
lines changed

articles/cognitive-services/Bing-News-Search/csharp.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,18 @@ Although this application is written in C#, the API is a RESTful Web service com
4646
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/news/search";
4747
const string searchTerm = "Microsoft";
4848
```
49-
## Create a struct to format the Bing News Search response
49+
50+
## Create a struct to format the Bing News Search response
5051

51-
1. Define a `SearchResult` struct to contain the image search results and JSON header information.
52+
Define a `SearchResult` struct to contain the image search results and JSON header information.
5253

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

6162
## Create and handle a news search request
6263

@@ -101,7 +102,7 @@ Create a method named `BingNewsSearch` to perform the call to the API, and set t
101102

102103
## Process the response
103104

104-
In the main method, call `BingNewsSearch()` and store the returned response. Then deserialize the JSON into an object. You can then view the values of the response.
105+
In the main method, call `BingNewsSearch()` and store the returned response. Then, deserialize the JSON into an object where you can view the values of the response.
105106

106107
```csharp
107108
SearchResult result = BingNewsSearch(searchTerm);

articles/cognitive-services/Bing-News-Search/java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
2424

2525
## Prerequisites
2626

27-
* The [Java Development Kit (JDK) 7 or 8](https://aka.ms/azure-jdks)
28-
* The [Gson library](https://github.com/google/gson)
27+
* The [Java Development Kit (JDK) 7 or 8](https://aka.ms/azure-jdks).
28+
* The [Gson library](https://github.com/google/gson).
2929

3030

3131
[!INCLUDE [cognitive-services-bing-news-search-signup-requirements](../../../includes/cognitive-services-bing-news-search-signup-requirements.md)]

articles/cognitive-services/Bing-News-Search/nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The source code for this sample is available on [GitHub](https://github.com/Azur
4747

4848
## Handle and parse the response
4949

50-
1. Define a function, named `response_handler`, that takes an HTTP call, `response`, as a parameter.
50+
1. Define a function named `response_handler` that takes an HTTP call, `response`, as a parameter.
5151

5252
2. Within this function, define a variable to contain the body of the JSON response.
5353

articles/cognitive-services/Bing-News-Search/php.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For more information, see [Cognitive Services Pricing - Bing Search API](https:/
3131

3232
To run this application, follow these steps:
3333

34-
1. Make sure that secure HTTP support is enabled in your `php.ini` file as described in the code comment.
34+
1. Make sure that secure HTTP support is enabled in your `php.ini` file, as described in the code comment.
3535
2. Create a new PHP project in your favorite IDE or editor.
3636
3. Add the code provided below.
3737
4. Replace the `accessKey` value with an access key valid for your subscription.

articles/cognitive-services/Bing-News-Search/python.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.custom: seodec2018
1616

1717
# Quickstart: Perform a news search using Python and the Bing News Search REST API
1818

19-
Use this quickstart to make your first call to the Bing News Search API. This simple JavaScript application sends a search query to the API and processes the JSON result.
19+
Use this quickstart to make your first call to the Bing News Search API. This simple Python application sends a search query to the API and processes the JSON result.
2020

2121
Although this application is written in Python, the API is a RESTful Web service compatible with most programming languages.
2222

@@ -26,8 +26,6 @@ To run this code sample as a Jupyter notebook on [MyBinder](https://mybinder.org
2626

2727
The source code for this sample is also available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/python/Search/BingNewsSearchv7.py).
2828

29-
## Prerequisites
30-
3129
[!INCLUDE [cognitive-services-bing-news-search-signup-requirements](../../../includes/cognitive-services-bing-news-search-signup-requirements.md)]
3230

3331
## Create and initialize the application
@@ -42,7 +40,7 @@ search_term = "Microsoft"
4240
search_url = "https://api.cognitive.microsoft.com/bing/v7.0/news/search"
4341
```
4442

45-
### Create parameters for the request
43+
## Create parameters for the request
4644

4745
Add your subscription key to a new dictionary, using `"Ocp-Apim-Subscription-Key"` as the key. Do the same for your search parameters.
4846

@@ -67,7 +65,7 @@ params = {"q": search_term, "textDecorations": True, "textFormat": "HTML"}
6765
descriptions = [article["description"] for article in search_results["value"]]
6866
```
6967

70-
## Displaying the results
68+
## Display the results
7169

7270
These descriptions can then be rendered as a table with the search keyword highlighted in **bold**.
7371

articles/cognitive-services/Bing-News-Search/ruby.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ms.custom: seodec2018
1616

1717
# Quickstart: Perform a news search using Ruby and the Bing News Search REST API
1818

19-
Use this quickstart to make your first call to the Bing News Search API. This simple JavaScript application sends a search query to the API and processes the JSON response.
19+
Use this quickstart to make your first call to the Bing News Search API. This simple Ruby application sends a search query to the API and processes the JSON response.
2020

21-
While this application is written in Python, the API is a RESTful Web service compatible most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/ruby/Search/BingNewsSearchv7.rb).
21+
Although this application is written in Ruby, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/ruby/Search/BingNewsSearchv7.rb).
2222

2323
## Prerequisites
2424

@@ -28,7 +28,7 @@ While this application is written in Python, the API is a RESTful Web service co
2828

2929
## Create and initialize the application
3030

31-
1. import the following packages into your code file:
31+
1. Import the following packages into your code file:
3232

3333
```ruby
3434
require 'net/https'
@@ -60,7 +60,7 @@ end
6060

6161
## Process and print the JSON response
6262

63-
After the response is received, you can parse the JSON, and print both the response body, and its headers:
63+
After the response is received, you can parse the JSON, and print both the response body, and its headers.
6464

6565
```ruby
6666
puts "\nRelevant Headers:\n\n"
@@ -173,4 +173,4 @@ A successful response is returned in JSON, as shown in the following example:
173173
## Next steps
174174

175175
> [!div class="nextstepaction"]
176-
> [Create a signle-page app](tutorial-bing-news-search-single-page-app.md)
176+
> [Create a single-page web app](tutorial-bing-news-search-single-page-app.md)

includes/cognitive-services-bing-news-search-signup-requirements.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ ms.date: 05/19/2020
1010

1111
Start using the Bing News Search API by creating one of the following Azure resources:
1212

13-
* [Trial resource](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api)
14-
* No Azure subscription is needed.
15-
* Valid for seven days, for free. After you sign up, a trial key and endpoint are available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
13+
[Trial resource](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api)
14+
* No Azure subscription is needed.
15+
* Valid for seven days, for free. After you sign up, a trial key and endpoint are available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
1616

17-
* [Bing Search v7 resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesBingSearch-v7)
18-
* Available through the Azure portal until you delete the resource.
19-
* Use the free pricing tier to try the service, and upgrade later to a paid tier for production.
17+
[Bing Search v7 resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesBingSearch-v7)
18+
* Available through the Azure portal until you delete the resource.
19+
* Use the free pricing tier to try the service, and upgrade later to a paid tier for production.
2020

21-
* [Multi-service resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne)
22-
* Available through the Azure portal until you delete the resource.
23-
* Use the same key and endpoint for your applications, across multiple Cognitive Services.
21+
[Multi-service resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne)
22+
* Available through the Azure portal until you delete the resource.
23+
* Use the same key and endpoint for your applications, across multiple Cognitive Services.

0 commit comments

Comments
 (0)