Skip to content

Commit 019db69

Browse files
authored
Updated constructor/class name
1 parent 5dbb0b9 commit 019db69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

samples/search/news_search_samples.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
import os
2+
13
from azure.cognitiveservices.search.newssearch import NewsSearchClient
24
from msrest.authentication import CognitiveServicesCredentials
35

46
# Add your Bing Search V7 subscription key to your environment variables.
57
SUBSCRIPTION_KEY = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
6-
8+
ENDPOINT = os.environ['BING_SEARCH_V7_ENDPOINT']
79

810
def news_search(subscription_key):
911
"""NewsSearch.
1012
1113
This will search news for (Quantum Computing) with market and count parameters then verify number of results and print out totalEstimatedMatches, name, url, description, published time and name of provider of the first news result
1214
"""
1315
client = NewsSearchClient(
14-
endpoint="https://api.cognitive.microsoft.com",
16+
endpoint=ENDPOINT,
1517
credentials=CognitiveServicesCredentials(subscription_key)
1618
)
1719

0 commit comments

Comments
 (0)