Pull Foursquare City and State Location - javascript

I have a landing page site and I would like to pull my latest checkin location.
EX:
Currently in San Francisco, CA
What is the best way to do this? Thanks!

I would use the Foursquare provided RSS Feed and use jQuery to parse the feed. Foursquare provides the feeds: https://foursquare.com/feeds/ and can use jQuery.ajax() http://api.jquery.com/jQuery.ajax/

Related

How can I get city name from geolocation data in node express mongoose mongoDb

I have this document in my collection inside a db in MongoDB
{
name: "steve",
id: 11,
address: "24 rue Victor Hugo"
geolocation:
{latitude:"16.66667",longitude:"101.18333"}
}
I want to get the city name from the geolocation data, I am working in Vs with node, express and mongoose. I tried to find a way to do without manipulating my db, because I already have my collection set before starting.
You can make requests with your geolocation parameters for address information.
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY
What you are trying to do is called reverse geocoding. It is available through the Google Maps Geocoding API. You have to sign up for a Google Developers account. Afterwards, you create a project from the Google Developers console. You can then request an API key. You can then use this API key in your request to the Google Maps API as follows:
https://maps.googleapis.com/maps/api/geocode/json?latlng=16.66667,101.18333&key=YOUR_API_KEY
Take a look at Google's Goecoding API documentation here. You can also test that URL in a browser to see the returned JSON-result, or using curl from the command-line.

API to get District, State and Country name from City name

I want to implement drop down what have auto complete facility for city name . and other drop down value automatically fill for district, state and country.
Is there is any api available for it?
I've been using Google Maps Api, Well it definitely works try looking at this link
Did you try Google Maps Place Details API ?
All you have to do is google "API for places" and find it !

Getting geolocation from IP address

I need to track user details, for that client's location and IP address is needed.
I got IP address from
$this->input->ip_address();
in codiigniter. Now the problem is how can i make their location in google map by using their respective IP address
just use ipinfo.io at
http://ipinfo.io/
it uses a location api that we can post ip address and it will returns the location details as json:
we can able to display the loacation on map with the langitude and longitude details from json response to google Maps API.
Here is the code i used:
this script creates a Google Map instance with lattitude & longitude from json response:
jQuery(document).ready(function(){
jQuery.get("http://ipinfo.io/202.88.237.138", function (response)
{
var lats = response.loc.split(',')[0];
var lngs = response.loc.split(',')[1];
map = new GMaps({
el: '#map',
lat: lats, //latitude
lng: lngs //longitude
});
}, "jsonp");
});
and the map will displayed on:
<div style="border:1px solid red; height:745px;" id="map"></div>
Google Maps API gmaps.js is needed to run this..
As a viable (although often less accurate) alternative, the HTML5 spec includes Geolocation. As HTML 5 becomes more and more prevalent I think we can expect to see this become standard in the future. It also does not require the use of external web services or libraries. Everything you need to geolocate is built right into the clients browser.
I believe the primary method used is IP address as specified.
The Google Maps API will do the work of finding location using geoip for you. If the user is on a mobile device or has a more accurate way of locating themselves (like a GPS), it'll use that instead.
Here's a good starting point:
https://google-developers.appspot.com/maps/documentation/javascript/examples/map-geolocation
If you absolutely need to fetch location from IP only, there are third-party tools that you can scrape to get this information. You should make sure you have permission beforehand if you're using this in a larger project.
freegeoip.net provides a public HTTP API to search the geolocation of IP addresses. It uses a database of IP addresses that are associated to cities along with other relevant information like time zone, latitude and longitude.
You're allowed up to 15,000 queries per hour.
If you need more than that, you can run the freegeoip as a web server on your own infrastructure. See: freegeoip on github

How to display weather data based on the browser location in cq5?

I need to display the weather information based on my location. Is there any API to do the same?
there is a good post how to use the geolocation from the clientcontext here http://blogs.adobe.com/livecycle/2011/10/bringing-geo-location-to-web-experience-management.html
that might give you a good start

place search api for nokia maps in http format?

I need an api for nokia maps place search with query and place term.
The API should be in http(url) format.
like this:
http://api.nokia.com/query=hotels/location=lat,long
It looks like you may be after the RESTful Places API. The latest documentation can be found here: http://developer.here.net/places
If you are after hotels, you could base your query on the example here:
http://developer.here.net/apiexplorer/examples/api-for-rest/places-search/places-search-by-category.html
The following URL will return a set of hotels in central Berlin (around 52.51N,13.4E)
http://demo.places.nlp.nokia.com/places/v1/discover/explore?cat=hotel&at=52.51,13.4&app_id=_peU-uCkp-j8ovkzFGNU&app_code=gBoUkAMoxoqIWfxWA5DuMQ&accept=application/json
See this link http://demo.places.nlp.nokia.com/places/v1/discover/explore?at=19.1273%2C72.8515&tf=plain&size=10&app_id=7vivA7jIFlZh9WX_B0cd&app_code=6ptUAobtF0RFJ9CkfX7geg&Geolocation=geo%3A19.0254%2C72.8401%3Bcgen%3Dmap . You can customize your search on left panel

Categories