Permalink
Browse files

Add a user agent header to the underscores.me request

  • Loading branch information...
1 parent 28c1afb commit 9909ffd7653a7d0ea422d1edd4c14ce9eedd8f66 @evansolomon committed Aug 18, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 _sh
View
5 _sh
@@ -30,7 +30,7 @@ description = raw_input('Description? ')
generate = 1
generate_submit = 'Generate'
-# Setup the POST data
+# Setup the request data
data = {
'underscoresme_name': name,
'underscoresme_slug': slug,
@@ -41,9 +41,10 @@ data = {
'underscoresme_generate_submit': generate_submit
}
post_body = urllib.urlencode(data)
+headers = {'User-Agent': '_sh'}
# Make the request
-request = urllib2.Request('http://underscores.me', post_body)
+request = urllib2.Request('http://underscores.me', post_body, headers)
response = urllib2.urlopen(request)
response.fp

0 comments on commit 9909ffd

Please sign in to comment.