plamoni/SiriProxy — Issue #304: How to retrieve Location -> City Name from iPhone?
Author: PianoThomas
Created: 2012-01-30 14:12:31+00:00
State: open

Hey,

Is there any possibility to retrieve the current location as a city name and put it in the terminal?

filter "SetRequestOrigin", direction: :from_iphone do |object|
puts "[Info - User Location] lat: #{object["properties"]["latitude"]}, long: #{object["properties"]["longitude"]}"
end

^^ this working perfecty!

BUT

filter "SetRequestOrigin", direction: :from_iphone do |object|
puts "[Info - User Location] city: #{object["properties"]["city"]}"
end

^^ is not working!

Why the hell isn't it working?

If you have a look in the lib-file in plamonis siriproxy folder you see:

class SiriLocation < SiriObject
def initialize(label="Apple", street="1 Infinite Loop", city="Cupertino", stateCode="CA", countryCode="US", postalCode="95014", latitude=37.3317031860352, longitude=-122.030089795589)
super("Location", "com.apple.ace.system")
self.label = label
self.street = street
self.city = city
self.stateCode = stateCode
self.countryCode = countryCode
self.postalCode = postalCode
self.latitude = latitude
self.longitude = longitude
end
end
add_property_to_class(SiriLocation, :label)
add_property_to_class(SiriLocation, :street)
add_property_to_class(SiriLocation, :city) # CITY ;D
add_property_to_class(SiriLocation, :stateCode)
add_property_to_class(SiriLocation, :countryCode)
add_property_to_class(SiriLocation, :postalCode)
add_property_to_class(SiriLocation, :latitude)
add_property_to_class(SiriLocation, :longitude)

How do I put the City name in the terminal?