urbanesia 0.0.1.5 → 0.0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/urbanesia/agent.rb +4 -4
- metadata +1 -1
data/lib/urbanesia/agent.rb
CHANGED
@@ -28,7 +28,7 @@ module Urbanesia
|
|
28
28
|
#### get should have replaced "," with "%2C" but I didn't put it into a separate
|
29
29
|
#### string. This is the same process in the self.requestify method.
|
30
30
|
#### Check this line first if any errors.
|
31
|
-
final_url = base_url + endpoint +
|
31
|
+
final_url = @base_url + endpoint + oauth_signature + "&" + get
|
32
32
|
|
33
33
|
agent = Mechanize.new
|
34
34
|
|
@@ -45,8 +45,6 @@ module Urbanesia
|
|
45
45
|
|
46
46
|
end
|
47
47
|
|
48
|
-
private
|
49
|
-
|
50
48
|
# The "nonce" is a string based on a timestamp, eg 946eeff5e43578078c746bb1df62145d
|
51
49
|
# The API is limited to one request per nonce.
|
52
50
|
def generate_nonce(time = Time.now)
|
@@ -55,7 +53,9 @@ module Urbanesia
|
|
55
53
|
|
56
54
|
# Combine any user-inputted post variables with the default post variables required for the API call.
|
57
55
|
def generate_default_post(post)
|
58
|
-
|
56
|
+
default_post = "oauth_consumer_key=" + @consumer_key + "&oauth_nonce=" + @nonce + "&oauth_signature_method=HMAC-SHA1&oauth_timestamp=" + @time + "&oauth_version=1.0&safe_encode=1"
|
57
|
+
default_post += "&" + post unless post.nil? or post == ""
|
58
|
+
return default_post
|
59
59
|
end
|
60
60
|
|
61
61
|
# Encode POST and GET for OAUTH
|