Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: antte/IMbored
base: c625540c53
...
head fork: antte/IMbored
compare: b011d45021
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/api_interpreters/lastfm_api_interpreter.rb
View
8 lib/api_interpreters/lastfm_api_interpreter.rb
@@ -5,12 +5,14 @@ class LastfmAPIInterpreter
include REXML
include ActionView::Helpers::SanitizeHelper
@@apiKey = "ff6907a95706562150e0b7f914ebf031"
+
def get_events(options)
@@request_coordinates = Geokit::LatLng.new( options[:latitude], options[:longitude] )
return getXMLByGeoParseToEventObjs(options[:longitude].to_f, options[:latitude].to_f, options[:distance].to_i)
end
def get_event(identifier)
+ @@request_coordinates = nil
return getXMLByIdParseToEventObj(identifier)
end
@@ -75,7 +77,11 @@ def populateEventFromXml(item)
item_coordinates = Geokit::LatLng.new(item.elements["venue/location/geo:point/geo:lat"].text, item.elements["venue/location/geo:point/geo:long"].text)
- distance_to_item = @@request_coordinates.distance_to(item_coordinates, :units=>:kms)
+ if @@request_coordinates == nil then
+ distance_to_item = "unknown"
+ else
+ distance_to_item = @@request_coordinates.distance_to(item_coordinates, :units=>:kms)
+ end
location = {
:street => item.elements["venue/location/street"] !=nil ? item.elements["venue/location/street"].text : "",

No commit comments for this range

Something went wrong with that request. Please try again.