File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ import os
2+
13from azure .cognitiveservices .search .customsearch import CustomSearchClient
24from msrest .authentication import CognitiveServicesCredentials
35
46SUBSCRIPTION_KEY = os .environ ['BING_CUSTOM_SEARCH_SUBSCRIPTION_KEY' ]
7+ ENDPOINT = os .environ ['BING_CUSTOM_SEARCH_ENDPOINT' ]
58
69def custom_search_web_page_result_lookup (subscription_key ):
710 """CustomSearch.
811
912 This will look up a single query (Xbox) and print out name and url for first web result.
1013 """
1114
12- client = CustomSearchClient (CognitiveServicesCredentials (subscription_key ))
15+ client = CustomSearchClient (
16+ endpoint = ENDPOINT ,
17+ credentials = CognitiveServicesCredentials (subscription_key ))
1318
1419 try :
1520 web_data = client .custom_instance .search (query = "xbox" , custom_config = 1 )
You can’t perform that action at this time.
0 commit comments