Permalink
Browse files

Add weather

  • Loading branch information...
1 parent c3af0d8 commit d061ec5987a58c80bbc56054980feefc5e591281 @kyleconroy kyleconroy committed Oct 14, 2012
Showing with 22 additions and 12 deletions.
  1. +1 −1 app.yaml
  2. +10 −9 docs/dynamic_apps.rst
  3. +11 −2 docs/setup.rst
View
@@ -6,7 +6,7 @@ threadsafe: true
handlers:
- url: /.*
- script: main_other.app
+ script: main.app
- url: /favicon\.ico
static_files: favicon.ico
View
@@ -202,25 +202,26 @@ Now visit your page. You'll see the following message.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello from San Francisco</Say>
- <Say>The current weather is Partly Cloudy, 65 F</Say>
+ <Say>The current weather is Partly Cloudy, 65 degrees</Say>
</Response>
-It seems that our message is missing a phone number. To test out the greeting,
-add the ``From`` parameter to your URL.
+Our city defaults to San Francisco. To test out the greeting, add the
+``FromZip`` and ``FromCity`` parameter to your URL.
.. code-block:: bash
- http://localhost:8080/?From=15005550000
+ http://localhost:8080/?FromZip=15601&FromCity=Greensburg
You should now see the phone number show up in your TwiML response.
.. code-block:: xml
- <?xml version="1.0" encoding="UTF-8"?>
- <Response>
- <Say>Hello 15005550000</Say>
- </Response>
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Response>
+ <Say>Hello from Greensburg</Say>
+ <Say>The current weather is Cloudy, 59 degrees</Say>
+ </Response>
Whenever an HTTP request is sent to your application it includes data in query
string and body of the request. The code we added when constructing the Say
@@ -229,7 +230,7 @@ parameter.
.. code-block:: python
- self.request.get('From')
+ self.request.get('FromZip')
Incoming Twilio Data
~~~~~~~~~~~~~~~~~~~~
View
@@ -128,11 +128,20 @@ browser window.
.. image:: _static/browseapp.png
-Your browser will open and you'll see "Hello World!" on screen. Let's take a moment and look at the URL that is loaded in your browser. The URL says ``http://localhost:8080/``. `localhost` is a special url that tells the browser to make a request to your local computer instead of out to the internet. The ``:8080`` portion tells the browser to make the request to port 8080. This url is not visible from the internet and, in general, is only visible to you.
+Your browser will open and you'll see "Hello World!" on screen. Let's take a
+moment and look at the URL that is loaded in your browser. The URL says
+``http://localhost:8080/``. `localhost` is a special url that tells the browser
+to make a request to your local computer instead of out to the internet. The
+``:8080`` portion tells the browser to make the request to port 8080. This url
+is not visible from the internet and, in general, is only visible to you.
.. note::
- While ``localhost`` urls will always address a user's local computer, its not entirely private. The application will also respond to your computer's IP address, so when developing applications be aware of your surroundings and of who else can possibly run your application on the network that you are connected to.
+ While ``localhost`` urls will always address a user's local computer,
+ its not entirely private. The application will also respond to your
+ computer's IP address, so when developing applications be aware of your
+ surroundings and of who else can possibly run your application on the
+ network that you are connected to.
In your text editor let's open up the file ``main.py`` at the root level of the
workshop directory. Change the word "World" on line 6 to your name and save the

0 comments on commit d061ec5

Please sign in to comment.