Skip to content
jhilden edited this page Sep 13, 2010 · 9 revisions

base url = http://test.talking-points.org

/locations/get_nearby/lat;lng.format

parameters:

latitude and longitude as floats
decimal point “.” needs to be replaced by a comma “,” to make the URL work for Rails
separated by a semicolon “;”
formats: xml, json

returns:

a hash of the locations within 1 kilometer radius. with the following info for each location:
tpid
lng
lat
distance in meters

example:

GET http://test.talking-points.org/locations/get_nearby/42,291930;-83,715724.xml

RESPONSE


<hash>

<location-6>
<tpid type="integer">6</tpid>
<lng>-83.715721</lng>
<lat>42.291919</lat>
<distance type="float">1.2534172704055</distance>
</location-6>

...

</hash>

/locations/get_address/lat;lng

parameters:

latitude and longitude as floats
decimal point “.” needs to be replaced by a comma “,” to make the URL work for Rails
separated by a semicolon “;”
there are no formats such as (xml, json) the return value is just a string

returns:

tries to find an address for the current coordinates. if it finds an address it is returned as a string, if not it returns “error”

example:

GET http://test.talking-points.org/locations/get_address/42,282736;-83,747134

RESPONSE

200-224 N 4th Ave, Ann Arbor, MI 48104, USA 

/locations/tpid.format

parameters:

tpid (Talking-Points database ID) of the location
formats: .xml, .json

returns:

a hash with all the information about this location

example:

GET http://test.talking-points.org/locations/1.xml

RESPONSE


<hash>
<city>Ann Arbor</city>
<name>Espresso Royale</name>
<status>Currently open for another 4 hours until 11pm</status>
<updated-at>2009-04-08 11:14:25 -0400</updated-at>
<postal-code>48104</postal-code>
<tpid type="integer">1</tpid>
<hide type="boolean">false</hide>
<sections>
	<Accessibility>beware of the steps going to the basement</Accessibility>
	<Hours>
	Mon through Fri from 6 am to 10 pm
	Saturday and Sunday from 7 am to 10 pm
	</Hours>
	<Comments>
		<comment-2>
			<datetime-in-words>27 days ago</datetime-in-words>
			<text>
			All the Espresso Royale cafes are pretty nice. For a chain, they try to make each location unique and not too corporate looking.
			</text>
			<title>Comment 1</title>
			<username>tichou</username>
			<id type="integer">2</id>
			<user-id type="integer">3</user-id>
			<datetime>2009-03-16 21:17:34 -0400</datetime>
		</comment-2>
....

/locations/show_by_bluetooth_mac/bluetooth_mac.format

Clone this wiki locally