Using Google Places API

by Blixim
4 replies
Hello Warriors ...

I am building a local business directory using the SabaiDirectory Plugin.

The Problem :
While the directory is "young" and don't have many listings, a lot of the searches will return " No Results Found"

The Solution :
Populate the directory search results using the Google Places API showing them the same local places listings they would see on a Google search. This will ensure my visitors ALWAYS get a search result even if I don't have any listed businesses for that keyword yet.

The following conditions must apply :
- If there are listings in the database (directory) those must show FIRST
- After which the Google Local Listings appear
- If there are no existing listings obviously only listings pulled from the Google Places API will show

I have a plugin that does almost exactly that, but I have to create a page "seeded with the keyword" for every keyword I want to pull results for. I obviously can not do that for thousands of different keyword-terms people "may" perhaps look for.
I need a plugin/code that will take ANY "search keyword" the user inputs and go pull results from Google if none is available in the database already.
The easierst/quickest may be to simply modify the existing plugin to "seed" a page with the users search term and then submit as normally.

Can anybody help me do any of the above perhaps?

Thanks in advance.
Henk
#api #google #places
  • Profile picture of the author seasoned
    Originally Posted by Blixim View Post

    I obviously can not do that for thousands of different keyword-terms people "may" perhaps look for.
    You can't do that for ANYONE. The idea is not to load it with what they may look for, but what they do look for. And that can only be done by using the querystring. But can't the google places API just accept it directly? I haven't used the google places API, but it really should have a way to pass the info directly.

    Steve
    {{ DiscussionBoard.errors[8181419].message }}
    • Profile picture of the author Blixim
      Originally Posted by seasoned View Post

      You can't do that for ANYONE. The idea is not to load it with what they may look for, but what they do look for. And that can only be done by using the querystring. But can't the google places API just accept it directly? I haven't used the google places API, but it really should have a way to pass the info directly.

      Steve
      Hi Steve, thank you for responding. Yes that's EXACTLY what I need ... a querystring that will take the keyword the user typed in, go query Google Places and return the related local places listings to be displayed as results in my directory. As I understand that's exactly what the Google Places API is there for ... problem is I cant write php. So I can't make my Business Directory "communicate" with Google Places API.
      And that is what I am asking for. If someone that knows php and knows how to do it can help me or show me how to do it.
      {{ DiscussionBoard.errors[8181635].message }}
  • Profile picture of the author seasoned
    Well, as a hint, taken from their Google places API page:

    The below example shows a search for restaurants near Sydney.

    https://maps.googleapis.com/maps/api...YourOwnKeyHere

    So you put the query in the tag called query. Plus signs(+) are a standard notation that means spaces, since ascii spaces generally aren't allowed as is. The ampersand(&) separates tags.

    Steve
    {{ DiscussionBoard.errors[8182109].message }}
    • Profile picture of the author Blixim
      Originally Posted by seasoned View Post

      Well, as a hint, taken from their Google places API page:

      The below example shows a search for restaurants near Sydney.

      https://maps.googleapis.com/maps/api...YourOwnKeyHere

      So you put the query in the tag called query. Plus signs(+) are a standard notation that means spaces, since ascii spaces generally aren't allowed as is. The ampersand(&) separates tags.

      Steve
      Hi Steve and thank you for your reply.
      I have now deliberated for more than a day but still have NO idea how to use the query string you provided. I just don't know enough of php to even understand what you are trying to tell me.
      As I understand things, ... somehow when someone types in a keyword into my directory search-box it must query the Google Places API and return the related listings, but I have no idea how to make that happen. I guess I will just have to go to Elance or Odesk to get someone to do it for me.

      Thanks for trying to help
      Regards
      Henk
      {{ DiscussionBoard.errors[8184922].message }}

Trending Topics