twitter_api 0.1.5 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 687522614099fad8793bf736f27656511b23f6f9
4
- data.tar.gz: 1ab167f48de4390e4cc094ba6e64f705cee7867e
3
+ metadata.gz: 38d793d0b24db37000c019ce66a7c411beb0d57e
4
+ data.tar.gz: 7905f164e4806be4105c978a3585cca74fc0a650
5
5
  SHA512:
6
- metadata.gz: dd9415e903be0cf2dbc90b8225536ca52791e12c5a1b49fbc7960acd0224b9b3c6a2c8723e7bba103183f8472735c53a347775062842f29a002dc438809261f4
7
- data.tar.gz: '02295227407b49e5d3d651075cfa270a64ce1a909704ffcd28c67487ce29fc3cbec9e1cf21d5560c7ac400fceccfe33a08083e4b01fc50868cf223694890b520'
6
+ metadata.gz: aed5952fdc70942e7705eae2178bc752b5a5271d7a361df4a2c28e46c5353f31eb21b1ff5c42638e7ef6ddeedd7a259b7d96db71033b19d8a370f544572e3665
7
+ data.tar.gz: ef968b928c7a4f5dbd1151c6de3e7898af4697021bee51c7fc68096f85a7dfa3ca4b7907272cfedb83031b4f1c38c26034635774b86e396265b9b17a31b42400
data/lib/twitter_api.rb CHANGED
@@ -99,60 +99,6 @@ module TwitterAPI
99
99
  super
100
100
  end
101
101
 
102
- # Calls a Twitter REST API using GET method.
103
- #
104
- # @param resource_url [String] Resource URL
105
- # @param params [Hash] Parameters
106
- # @return [TwitterAPI::Response]
107
- def get(resource_url, params)
108
- headers = {'Authorization' => authorization('GET', resource_url, params)}
109
- url = resource_url + '?' + URI.encode_www_form(params)
110
- res = open(url, headers)
111
- Response.new(res)
112
- end
113
-
114
- # Calls a Twitter REST API using POST method.
115
- #
116
- # @param resource_url [String] Resource URL
117
- # @param params [Hash] Parameters
118
- # @param data [String] Posts data
119
- # @return [TwitterAPI::Response]
120
- def post(resource_url, params, data=nil)
121
- headers = {'Authorization' => authorization('POST', resource_url, params)}
122
- url = resource_url + '?' + URI.encode_www_form(params)
123
- uri = URI.parse(url)
124
- http = Net::HTTP.new(uri.host, uri.port)
125
- http.use_ssl = true
126
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
127
- res = http.request_post(url, data, headers)
128
- Response.new(res)
129
- end
130
-
131
- # Calls a Twitter REST API using POST (multipart/form-data) method.
132
- #
133
- # @param resource_url [String] Resource URL
134
- # @param params [Hash] Parameters
135
- # @param data [Array] Posts Multipart data
136
- # @return [TwitterAPI::Response]
137
- def post_multipart(resource_url, params, data={})
138
- headers = {'Authorization' => authorization('POST', resource_url, params)}
139
- url = resource_url + '?' + URI.encode_www_form(params)
140
- uri = URI.parse(url)
141
- form_data = []
142
- data.each{|k,v|
143
- form_data << [k,v]
144
- }
145
- http = Net::HTTP.new(uri.host, uri.port)
146
- http.use_ssl = true
147
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
148
- req = Net::HTTP::Post.new(uri.request_uri, headers)
149
- req.set_form(form_data, 'multipart/form-data')
150
- res = http.start{|h|
151
- h.request(req)
152
- }
153
- Response.new(res)
154
- end
155
-
156
102
  # GET geo/id/:place_id
157
103
  # {https://dev.twitter.com/rest/reference/get/geo/id/place_id}
158
104
  #
@@ -1,3 +1,3 @@
1
1
  module TwitterAPI
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoki Iwasawa