diff --git a/README.md b/README.md index 43d8753..3324783 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Try it: http://these3words.herokuapp.com/ Some interesting locations: -* [Battery Park, NYC](http://these3words.herokuapp.com/nikaya-caput-mahon) -* [Downtown San Francisco](http://these3words.herokuapp.com/stitt-budged-tower) -* [Sydney, Australia](http://these3words.herokuapp.com/scone-scud-inbox) +* [Battery Park, NYC](http://these3words.herokuapp.com/huai-sora-pelayo) +* [Downtown San Francisco](http://these3words.herokuapp.com/smite-arends-nagler) +* [Sydney, Australia](http://these3words.herokuapp.com/cuyler-propor-marias) This app was inspired by http://what3words.com/ @@ -24,7 +24,7 @@ example >>> three = these.three_words(CERN) >>> print three - 'closet-chou-maurel' + 'turks-yunnan-salant' >>> these.decode(three) (46.232335567474365, 6.055419445037842) @@ -103,7 +103,7 @@ brought to you by [@betatim][betatim] and [@kdungs][kdungs] productions [humanhash]: https://github.com/zacharyvoase/humanhash [geohash]: https://code.google.com/p/python-geohash/ -[cernmap]: http://these3words.herokuapp.com/closet-chou-maurel +[cernmap]: http://these3words.herokuapp.com/turks-yunnan-salant [othercernmap]: http://these3words.herokuapp.com/spaghetti-carolina-kentucky-utah-seventeen-neptune [bottlepy]: http://bottlepy.org/ [betatim]: https://twitter.com/betatim diff --git a/app.py b/app.py index d6b360a..c6ea366 100755 --- a/app.py +++ b/app.py @@ -11,6 +11,11 @@ from bottle import ( import thesethreewords as these +example_locs = [("sydney", (-33.867480754852295, 151.20700120925903)), + ("battery", (40.70329427719116, -74.0170168876648)), + ("san_fran", (37.790114879608154, -122.4202036857605))] +example_locs = dict((name,these.three_words(pos)) for name,pos in example_locs) + @get('/static/') def serve_static(filename): return static_file(filename, root='static') @@ -18,7 +23,7 @@ def serve_static(filename): @get('/') def index(): - return template('index', err=None) + return template('index', err=None, **example_locs) @get('/') @@ -28,7 +33,8 @@ def showMap(threewords): return template('map', lat=lat, lng=lng, threewords=threewords) except: return template('index', - err="Could not find location {}".format(threewords)) + err="Could not find location {}".format(threewords), + **example_locs) @get('/latlng/,') @@ -38,7 +44,8 @@ def showMapFromLatLng(lat, lng): return template('map', lat=lat, lng=lng, threewords=threewords) except: return template('index', - err="Could not find location {}".format(threewords)) + err="Could not find location {}".format(threewords), + **example_locs) # API diff --git a/views/index.html b/views/index.html index 90a9c3d..b8b8c1f 100644 --- a/views/index.html +++ b/views/index.html @@ -28,12 +28,12 @@

  • Type in a location to find out the three words by which to remember it (try 1600 Pennsylvania avenue ...)
  • -
  • To find the location referenced by a set of three words given to you, type them in separated by a dash (try scone-scud-inbox)
  • +
  • To find the location referenced by a set of three words given to you, type them in separated by a dash (try {{ sydney }})
  • Go straight to exploring the map by clicking the Find on Map button, it will take you to Sydney

- +

@@ -41,9 +41,9 @@

Some interesting locations to try out:

@@ -54,7 +54,7 @@