Permalink
Browse files

Using raw_input to ask for keys, rename variables

Instead of asking the user to edit the file. We should also probably allow the user to test just api_key and not providor if they wanted to check that.
  • Loading branch information...
1 parent 4c59a82 commit 6dd66324b5b86dd4f0362b9bca6a1251315d6879 @jacobb committed Mar 14, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 demos/example-1-2.py
View
@@ -35,18 +35,18 @@
"""
import prowlpy
-# get a apikey and provider key at https://www.prowlapp.com/api_settings.php
-apikey = 'sdfsdfsdfsdffdfsdf' # insert your API key
-pkey = 'sfsdfasdfadsfsdfsf' # insert your provider key
+# get a api_key and provider key at https://www.prowlapp.com/api_settings.php
+api_key = raw_input('Api Key: ')
+provider_key = raw_input('Provider Key (optional): ')
-p = prowlpy.Prowl(apikey)
+p = prowlpy.Prowl(api_key)
# get token for user
-response = p.retrieve_token(pkey)
+response = p.retrieve_token(provider_key)
print "I got token %s for %s" % (response['token'], response['url'])
# assuming that the user has accepted your request
# (they go to the response["url"] via a browser to accept)
-# retrieve his/her apikey
-users_apikey = p.retrieve_apikey(pkey, response["token"])
+# retrieve his/her api_key
+users_api_key = p.retrieve_apikey(provider_key, response["token"])

0 comments on commit 6dd6632

Please sign in to comment.