Skip to content

Commit

Permalink
Use lat/lng in geo functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdub committed Feb 18, 2011
1 parent 004f4a5 commit 236d362
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,41 +899,41 @@ Twitter.prototype.geoSearch = function(params, callback) {
return this;
}

Twitter.prototype.geoSimilarPlaces = function(lat, lon, name, params, callback) {
Twitter.prototype.geoSimilarPlaces = function(lat, lng, name, params, callback) {
if (typeof params === 'function') {
callback = params;
params = {};
} else if (typeof params !== 'object') {
params = {};
}

if (typeof lat !== 'number' || typeof lon !== 'number' || !name) {
if (typeof lat !== 'number' || typeof lng !== 'number' || !name) {
callback(new Error('FAIL: You must specify latitude, longitude (as numbers) and name.'));
}

var url = '/geo/similar_places.json';
params.lat = lat;
params.long = lon;
params.long = lng;
params.name = name;
this.get(url, params, callback);
return this;
}

Twitter.prototype.geoReverseGeocode = function(lat, lon, params, callback) {
Twitter.prototype.geoReverseGeocode = function(lat, lng, params, callback) {
if (typeof params === 'function') {
callback = params;
params = {};
} else if (typeof params !== 'object') {
params = {};
}

if (typeof lat !== 'number' || typeof lon !== 'number') {
if (typeof lat !== 'number' || typeof lng !== 'number') {
callback(new Error('FAIL: You must specify latitude and longitude as numbers.'));
}

var url = '/geo/reverse_geocode.json';
params.lat = lat;
params.long = lon;
params.long = lng;
this.get(url, params, callback);
return this;
}
Expand Down

0 comments on commit 236d362

Please sign in to comment.