Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Microsoft Bing Translation PHP wrapper
Sep 07, 2011 @ 14:43:25

In a new post to his blog today Sameer Borate spotlights a translation wrapper for Bing that lets you easily use their API to translate text or determine what language the given text is in.

Microsoft Language translation is an interesting service. Not only can you do language translation, you can also detect the language of a particular text. The given class provides a PHP wrapper which will help developers translate text from one language to another in a easy manner. The library also supports caching, helping you keep your translations fast and simple.

His translation library requires an AppId for configuration and cURL to handle the messaging back and forth. Translation is as easy as calling "translate()" on a string, language fetching with "LanguageNames()" and even converting the text to speech with the "speak()" method.

tagged: bing translation wrapper appid api language

Link:

Derick Rethans' Blog:
Translating Twitter, part 2
Jun 02, 2011 @ 16:28:40

Derick Rethans has posted the second part of his look at translating twitter as a part of his PHP-GTK Twitter client Haunt. Because of the deprecation route Google chose for its translation API, he needed a change to another service - the Bing Translation API.

A while ago I wrote in an article about translating tweets in my client Haunt. For the translating itself I was using the Google Translate API, which has sadly be deprecated. Evil after all I suppose. I've now rewritten my translation code to use the Bing Translation APIs instead. You need to register an API key (see http://www.bing.com/developers/appids.aspx) to be able to use the APIs. The APIs that I am using are fairly simple though.

Also included in the post is some sample code showing how to make the request to this new API and the results from the requests.

tagged: translate twitter haunt bing google api webservice

Link:

Aaron McGowan' Blog:
Geocoding search terms with Bing Maps
Nov 17, 2010 @ 18:28:40

Aaron McGowan has a new post to his blog that looks at the work he's done interfacing with the Bing Maps API to do some geocoding for Emitter.ca.

One of the key features which was required for Emitter.ca, was the ability to geocode search terms like street addresses, cities, and postal codes, that a user enters so that Emitter.ca could easily return facilities that are nearby. To do this, we leveraged Bing Maps's API for performing the Geocode lookup. Microsoft offers a variety of APIs for allowing your application to interact with Bing Maps, however, for Geocoding search terms, we utilized Bing's SOAP API.

He shares the class he uses to pull the information out of the Bing Maps SOAP response and push the details into the properties of a class. The simpel class made interfacing with the API an easy task and allowed for string-based lookups on just about anywhere (like "Toronto, Ontario").

tagged: geocode search bing maps soap api

Link:

php|architect:
Bing Powered 404 for non-WordPress websites
Jun 17, 2010 @ 14:10:29

Following up on his Bing 404 plugin for WordPress article, Cal Evans has put together an example for those not using WordPress to accomplish the same thing.

I had several people tell me that while they liked the idea, they didn't want to install WordPress just so they can have intelligent 404 errors. Several other people pinged me and suggested a way that you could use the Bing Search API to handle 404's without WordPress. As a public service, I am going to try and bridge the gap between these two groups. Going on leads provided by friends, I have hammered out a solution that works with Apache and PHP.

The solution uses a custom 404 page (as set in Apache) that pulls in the "top ten" links from the current site as reported back by the Bing.com search engine. With the help of the API making a request and getting back an object to loop through is simple. This could easily be adapted to accept terms based on the content page that they were trying to find or some keywords based on your site's content.

tagged: bing wordpress search 404 error apache tutorial

Link:

php|architect Blog:
WordPress 404 Plugin built on Bing Wrapper
Jun 07, 2010 @ 14:45:44

Based on a recent plugin he's developed, Cal Evans has posted this new tutorial on how to use it in a 404 plugin for WordPress to give the visitor more relevant information even when they don't find what they wanted.

One of the things I’ve always hated about WordPress is the stock 404 error message. Out of the box, WordPress just tells users "I’m sorry, I can’t find what you are looking for." Granted it is better than the stock Apache 404 page but it isn’t much more helpful. Having just finished working on the Bing Search Wrapper for PHP, the best use case I could think of for the wrapper was to solve this particular problem. This is how I helped Microsoft’s Interoperability team to put together the Bing 404 Plugin for WordPress.

He includes two ways to do it - either watch the video for a quickstart or you can follow the "gory details" on how it all works and how/where to implement it in your WordPress insallation's code.

tagged: wordpress plugin bing wrapper search tutorial

Link:

Cal Evans' Blog:
Bing Search API wrapper for PHP
Jun 02, 2010 @ 15:53:58

In conjunction with some of the folks over at Microsoft Cal Evans has created a search wrapper around the Bing search engine's API to make interacting with it from your PHP applications simpler.

Back in March I had the opportunity to work on a project for Microsoft that is now coming to light. I was tasked with writing a PHP wrapper for the Bing API that Microsoft has been building. I’ve written API wrappers before and it is either a fun experience or it is a nightmare, depending on whether the API is easy to work with. I am pleased to report that the Bing Search API is well thought out and very easy to work with. For PHP developers, I am hoping that what I am about to show you makes it even easier.

You'll need an API key to use the interface, but the rest is simple. You just create an instance of the search object, pass it a query and sun the "search" method to return the results. Cal has an example snippet of code in his blog.

tagged: bing search wrapper api apikey

Link:

Dev+Mocha Blog:
Bing API PHP
Jun 12, 2009 @ 17:09:29

From the Dev+Mocha blog (routecafe.com) there's a post showing off an API to let your PHP scripts interface with the Bing.com site from Microsoft.

Well, since the opening of bing.com I've been playing with the API and some of the options it provides. Certainly I was getting annoyed since I had to rebuild each of my queries if I wanted something so I search for a library that could do this for me which I couldn't find and I ended up writing my own.

His API allows for a fluent interface to interact with Bing and grab the results from a search. The example given searches the site for "gimp" and returns the first ten values in an XML format. You can download the API here.

tagged: library api bing

Link:


Trending Topics: