def get_phones(addr1, city, state, zip): config = ConfigParser.ConfigParser() config.readfp(open(os.path.join('/', os.path.dirname(os.path.dirname( os.path.dirname(os.path.join(os.path.abspath(__file__))))), 'phone.cfg'))) session = TembooSession('cd34', config.get('temboo', 'APP_KEY_NAME'), config.get('temboo', 'APP_KEY_VALUE')) address = '{addr} {city}, {state} {zip}'.format( addr=addr1, city=city, state=state, zip=zip) geocodeByAddressChoreo = GeocodeByAddress(session) geocodeByAddressInputs = geocodeByAddressChoreo.new_input_set() geocodeByAddressInputs.set_Address(address) geocodeByAddressResults = geocodeByAddressChoreo \ .execute_with_results(geocodeByAddressInputs) latitude = geocodeByAddressResults.get_Latitude() longitude = geocodeByAddressResults.get_Longitude() localListChoreo = LocalList(session) localListInputs = localListChoreo.new_input_set() localListInputs.set_AuthToken(config.get('twilio', 'auth_token')) localListInputs.set_AccountSID(config.get('twilio', 'account_sid')) localListInputs.set_Latitude(latitude) localListInputs.set_Longitude(longitude) localListInputs.set_Distance(10) localListInputs.set_PageSize(10) TwilioResults = localListChoreo.execute_with_results(localListInputs) numbers = TwilioResults.getJSONFromString(TwilioResults.get_Response()) return numbers['available_phone_numbers']
def locationGPS(): from temboo.Library.Google.Geocoding import GeocodeByAddress from temboo.core.session import TembooSession locale = callback() session = TembooSession('jack727', 'myFirstApp', 'ZjdczC9s7nPiHX80gyXx7YxkoYVDQRBK') geocodeByAddressChoreo = GeocodeByAddress(session) geocodeByAddressInputs = geocodeByAddressChoreo.new_input_set() geocodeByAddressInputs.set_Address(str(locale)) geocodeByAddressResults = geocodeByAddressChoreo.execute_with_results(geocodeByAddressInputs) Talk('Okay ' + GlobalFile.user + ' here is your location') Talk("Longitude: " + geocodeByAddressResults.get_Longitude,1()) Talk("Latitude: " + geocodeByAddressResults.get_Latitude, 1())
from temboo.Library.Google.Geocoding import GeocodeByAddress from temboo.core.session import TembooSession # Create a session with your Temboo account details session = TembooSession("ngandrea", "myFirstApp", "1d24c665d3394db49ed936e8853585d0") # Instantiate the Choreo geocodeByAddressChoreo = GeocodeByAddress(session) # Get an InputSet object for the Choreo geocodeByAddressInputs = geocodeByAddressChoreo.new_input_set() # Set the Choreo inputs geocodeByAddressInputs.set_Address("21 Tampines Ave 1, 529757") geocodeByAddressInputs.set_ResponseFormat("json") # Execute the Choreo geocodeByAddressResults = geocodeByAddressChoreo.execute_with_results(geocodeByAddressInputs) # Print the Choreo outputs print("Latitude: " + geocodeByAddressResults.get_Latitude()) print("Response: " + geocodeByAddressResults.get_Response()) print("Longitude: " + geocodeByAddressResults.get_Longitude())
from temboo.Library.Google.Geocoding import GeocodeByAddress from temboo.core.session import TembooSession # Create a session with your Temboo account details session = TembooSession("accountName", "myFirstApp", "abc123xxxxxxxxxxxxxx") # Instantiate the Choreo geocodeByAddressChoreo = GeocodeByAddress(session) # Get an InputSet object for the Choreo geocodeByAddressInputs = geocodeByAddressChoreo.new_input_set() # Set credential to use for execution geocodeByAddressInputs.set_credential('Omar') # Execute the Choreo geocodeByAddressResults = geocodeByAddressChoreo.execute_with_results( geocodeByAddressInputs) # Print the Choreo outputs print("Latitude: " + geocodeByAddressResults.get_Latitude()) print("Longitude: " + geocodeByAddressResults.get_Longitude()) print("Response: " + geocodeByAddressResults.get_Response())