bing-api

How to remove %EF%BB%BF in a PHP string

血红的双手。 提交于 2019-12-01 08:54:30
I am trying to use the Microsoft Bing API. $data = file_get_contents("http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appId=APPID&text={$text}&language=ja&format=audio/wav"); $data = stripslashes(trim($data)); The data returned has a ' ' character in the first character of the returned string. It is not a space, because I trimed it before returning the data. The ' ' character turned out to be %EF%BB%BF. I wonder why this happened, maybe a bug from Microsoft? How can I remove this %EF%BB%BF in PHP? You could use substr to only get the rest without the UTF-8 BOM : // if it’s binary UTF-8

How to remove %EF%BB%BF in a PHP string

依然范特西╮ 提交于 2019-12-01 06:37:46
问题 I am trying to use the Microsoft Bing API. $data = file_get_contents("http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appId=APPID&text={$text}&language=ja&format=audio/wav"); $data = stripslashes(trim($data)); The data returned has a ' ' character in the first character of the returned string. It is not a space, because I trimed it before returning the data. The ' ' character turned out to be %EF%BB%BF. I wonder why this happened, maybe a bug from Microsoft? How can I remove this %EF%BB

What is the best way to translate a big amount of text data?

痞子三分冷 提交于 2019-11-30 15:00:52
问题 I have a lot of text data and want to translate it to different languages. Possible ways I know: Google Translate API Bing Translate API The problem is that all these services have limitations on text length, number of calls etc. which makes them inconveniente in use. What services / ways you could advice to use in this case? 回答1: I had to solve the same problem when integrating language translation with an xmpp chat server. I partitioned my payload (the text i needed to translate) into

What is the best way to translate a big amount of text data?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 13:31:10
I have a lot of text data and want to translate it to different languages. Possible ways I know: Google Translate API Bing Translate API The problem is that all these services have limitations on text length, number of calls etc. which makes them inconveniente in use. What services / ways you could advice to use in this case? I had to solve the same problem when integrating language translation with an xmpp chat server. I partitioned my payload (the text i needed to translate) into smaller subsets of complete sentences. I cant recall the exact number but with googles rest based translation url

Steps of creating appid for bing search

大憨熊 提交于 2019-11-30 09:52:53
问题 I am really stuck with the bing search Api. In bing's developer centre I do not find any option to generating Appid. Actually I want to used the bing's search functionality using curl. When I try to hit the Api it displayed the following error : computer test2001AppID is not functioning properly. Please refer to the HelpUrl to get more information.http://msdn.microsoft.com/en-us/library/dd251042.aspx Array ( [SearchResponse] => Array ( [Query] => Array ( [SearchTerms] => computer test )

How do I use the Bing Search API in Windows Phone?

社会主义新天地 提交于 2019-11-30 07:37:31
I'm trying to use the Bing Search API to find images as backgrounds to the tiles inside of my app. I've included the BingSearchContainer.cs in my Project but I can't make it work with the sample code provided here. Any guidelines for how to use the Bing Search API inside of my Windows Phone 8 app would be appriciated! Thanks for any answer. I expect that you already have a AccountKey so I wont tell you have to get one. Implementation First of all, add the BingSearchContainer.cs to your project Implement the sample C# code found in the Bing API Quick Start & Code Thereafter, right-click

Steps of creating appid for bing search

北城余情 提交于 2019-11-29 18:09:16
I am really stuck with the bing search Api. In bing's developer centre I do not find any option to generating Appid. Actually I want to used the bing's search functionality using curl. When I try to hit the Api it displayed the following error : computer test2001AppID is not functioning properly. Please refer to the HelpUrl to get more information.http://msdn.microsoft.com/en-us/library/dd251042.aspx Array ( [SearchResponse] => Array ( [Query] => Array ( [SearchTerms] => computer test ) [Errors] => Array ( [Error] => Array ( [Code] => 2001 [Message] => AppID is not functioning properly. Please

Get business type/industry from Bing Phonebook API

筅森魡賤 提交于 2019-11-29 17:40:47
The below example shows how I'm building the query string that will return a bunch of addresses for the search parameters defined in the query string (in this case, Starbuck's)...I'm wondering if it's possible to use the Bing Phonebook API to define a type of entity that you're looking for e.g. Cafe, Gas Station, Software Company, etc...? function Search(position) { // note a bunch of this code uses the example code from // Microsoft for the Phonebook API var requestStr = "http://api.bing.net/json.aspx?" // Common request fields (required) + "AppId=" + _appId + "&Query=starbucks" + "&Sources

Bing Search API Azure Marketplace Authentication in Java

ⅰ亾dé卋堺 提交于 2019-11-28 12:29:47
How can I authenticate in Java to use the new bing search api from Azure Marketplace?The migration guide does not provide you with info about Java You'll need to encode your accountKey to Base64 and pass it to each request using the Authorization header. String bingUrl = "https://api.datamarket.azure.com/Bing/Search/................"; String accountKey = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; byte[] accountKeyBytes = Base64.encodeBase64((accountKey + ":" + accountKey).getBytes()); String accountKeyEnc = new String(accountKeyBytes); URL url = new URL(bingUrl); URLConnection urlConnection

What are the query length limits for the Bing WebSearch API?

让人想犯罪 __ 提交于 2019-11-28 04:42:06
问题 Given that the Bing API docs consist primarily of an error-ridden, two-page Word document, I have not been able to find the answer to this online. Trial and error has produced inconsistent results, and given that queries cost money, I'd rather not have to guess and check any more. What are the length limits are on the new 'Azure marketplace' Bing WebSearch API? I know there is a limit of some sort, because long queries tend to return, "The request was not accepted by the data provider's