How to specify location on Bing in the URL - php

I am doing some minor cURL work and, unlike Google, Bing defaults the search results to the location of the server. I am trying to find a parameter to set that allows me to specify location, for example UK/US, but I haven't had much luck.
Does anyone know or have a link to an article explaining this?
Thanks in advance!

I actually found it, after searching for 30 minutes and posting this I stumbled upon it. You can set it using the something like "setmkt=fr-fr"
Where the first is the language, the second the location. I can't be sure what it will accept but I figure playing with that will get the desired results.

Bing! probably does it based on the IP of the connecting client.
Since you can't change that (other than connecting via a proxy, which is a whole different story), you cannot manually set the location for your search results (unless of course, Bing! has an option or an API which allows it).

I believe you could use the Location Data parameter:
http://msdn.microsoft.com/en-us/library/ff701726.aspx
You can specify countryRegion to limit the results to a certain country:
A string specifying the country or region name of an address.
Example: United States

Related

Autocompleteplus how to detect user language(Real language not browser)?

I'm looking for a way to get a user default language by the country. For example I have windows in english but still I would like to get my country 2 letter language ("cs")
You can see an example of what I want, In the source code of http://search.conduit.com/ using (Autocompleteplus) as well. This is what I see:
window.language = "en-us";
window.countryCode = "cz";
window.suggestBaseUrl = "http://api.autocompleteplus.com/?q=UCM_SEARCH_TERM&l=cs&c=cz&callback=acp_new";
You can see the api url has inside "l=cs&c=cz" how did they get this information? I would like to have the same thing I use the same autocompleteplus method just need a way to generate the l=(user true langague)&c=(country code) and performance is important as well. It's autosuggestions for my website search.
This is Ed from AutoComplete+. Getting the user country is typically done when using our API through server side implementations. There are however some open APIs that can assist you. Regardless, you can use our autocomplete feed without the user country. Feel free to contact us directly for further info at http://www.autocompleteplus.com
Thanks,
--ed

J-locate on joomla platform

I created an external link for J-locate plugin for Joomla that would help show a certain locations I need on the map since there is no way to set a default location through the plugin. It goes something like this: view=jlocate&state=nc&zip=27604&radius=10
I am trying to figure out a way to get rid of the state filter so it doesn't restrict the zipcodes closest location by the states. Is it possible to put multiple states in the external link I made? It would be nice if it works so it filters through all states, i tried putting something like the following: view=jlocate&state=nc&ca&fl&zip=27604&radius=10 so it would go through multiple states but it only selects the first one, so if the zipcode is not in NC, it wouldn't find it.
My goal is to make the map available so anyone can search all states by the zipcode field alone without putting in a state. This will resolve a border line locations that i am facing right now due to the fact that its filtering states.
Thank you in advance for any positive help.
here is the link to the plugin i am using: http://joomlavida.com/jlocate-joomla-store-locator-demo?zip=33761&state=FL
It really depends on the component.
The correct way to pass a list could be an array
&state[]=nc&state[]=va&state[]=nj
but since you want to do without, why not omit it? If it's forced somewhere beyond your control you could still unset() it.
Otherwise in the unlikely scenario that the programmer is not doing server-side sql injection filtering, pass
&state=%
where % is the wildcard for SQL.

IP to location + local time?

Currently I've been using http://www.geoiptool.com/ but I can't get the local time. I don't know what to do to get the local time.
Can someone help me out, to display location + local time? I have a mail app and I try to display IP in location + local time.
Well, this is not real answer to your question but can help you to properly understand how inaccurate this method is.
Please, read this answer as a side note.
Yes, it's OK to offer or set location/time for your users. But you should provide country/time selector for them also. Some of IP's can not be resolved properly (anonymous proxy, borrowed IPs from other countries (my case), continental IPs (like group "Europe", "Asia", etc), etc.
My case shows how this approach may be wrong.
When I've tried ipLocator from geobytes.com I've got this:
My IP address has been resolved to:
Location: Romania
Time offset: +0200 (at the moment DST is active so it's +0300)
Real problem is that my location is not Romania, and my time offset is +0100/+0200.
Look this picture:
Red arrow shows my real location. Info in black box shows correct values for my real location. Well, wrong location is not such a big problem for users, but wrong local time is very annoying thing.
Yes, I know, that's not what you're looking for. But you should not fix users location and/or local time because it can be wrong approach. IPv4 address is certainly not something accurate to get real info about user.
Also, I found that ipLocator doesn't follow DST rules and using that time offset (image #1) will show wrong local time during Summer (for countries/regions/provinces which consider DST).
Geobytes will give you the offset:
http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress=64.34.119.12
Or in an XML format (you might need to view source to see it):
http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress=64.34.119.12
This will give you the offset, just add/subtract the offset to GMT/UTC.

is it possible to find geolocation using zipcode using PHP

Is it possible to find geolocation using zip code using PHP.
For example, if i am entering the zip code i need to find the name of that particular zipcode.
Is that possible? if yes kindly explain me how?
Thanks in advance
See the duplicate question on how to turn an address into coordinates using the Google Geocoding service.
A query in the format [zipcode], United States, e.g..
72116, United States
should always work for you.
Try maps.google.com to simulate the request.
The XML returned from the Google Service will contain the official place name, as well as other information like county and state names etc.
You can do this through Javascript and PHP using Google's Map API - check this question for an example of how this is used.
I dont think it can be done solely through PHP however because you'd need to access an API's data and they normally (not always) do this through javascript.
You should check the API documentation.
You can access the Geocoding API solely using PHP.. you don't even need an API Key anymore.
http://code.google.com/apis/maps/articles/phpsqlgeocode.html
So if understand this correctly, you want to know the City/State of the zip code you have entered?
Maybe you should look into the Access database here :
http://databases.about.com/od/access/a/zipcodedatabase.htm
And if you find it useful, just convert it into a MySQL table and use as you please.

Location searching

For the site I am building I want the user to be able to search for a location, however because I don't have a list of locations for the UK, I have developed a script in PHP which calls: http://ajax.googleapis.com/ajax/services/search/local in order to get the lat and lon coordinates of this location to store in the database for future use.
This works well apart from if I search for a town, for example Heaton, it brings back the one in Staffordshire rather than the one in Newcastle for example.
The whole reason I'm using the google ajax api is to cut down the google requests per day because I don't want to exceed the daily request limit.
As you can see though, I've hit a brick wall because the search isn't refined enough to bring back the correct location.
Can anyone suggest another way around this? I'm quite stuck. Thanks
I don't know if you have seen this already, but there is a parameter in the Google Search API that allows you to specify a boundary for the search:
GeocoderRequest object specification
The specification for a geocoding
request to be sent to the Geocoder.
Properties Type Description
address string Address. Optional.
bounds LatLngBounds LatLngBounds within which to search. Optional.
language string Preferred language for results. Optional.
location LatLng LatLng about which to search. Optional.
region string Country code top-level domain within which to search.
In your case I would specify a bounds around northumberland, so something like:
http://ajax.googleapis.com/ajax/services/search/local?q=heaton&v=3.1&region=GB&sensor=false&bounds=(55.395,%20-2.510%20,2054.342,%20-0.417)
might work...? I don't know if this would be relevant to your app though. Good luck!

Categories