Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 6dd66324b5b86dd4f0362b9bca6a1251315d6879 1 parent 4c59a82
@jacobb authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 demos/example-1-2.py
View
14 demos/example-1-2.py
@@ -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"])
Please sign in to comment.
Something went wrong with that request. Please try again.