dschn-tweetsy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/tweetsy/client.rb +8 -6
  3. metadata +2 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 0
4
4
  :minor: 1
@@ -43,11 +43,6 @@ module Tweetsy
43
43
  doc = request(:post, "/friendships/create/#{id_or_screen_name}.xml", :auth => true)
44
44
  User.new(doc.at('user'))
45
45
  end
46
-
47
- def destroy_friendship(id_or_screen_name)
48
- doc = request(:post, "/friendships/destroy/#{id_or_screen_name}.xml", :auth => true)
49
- User.new(doc.at('user'))
50
- end
51
46
 
52
47
  def update(status, options = {})
53
48
  form_data = { :status => status }
@@ -73,6 +68,13 @@ module Tweetsy
73
68
  (doc/:ids/:id).inject([]) { |friends_ids, id| friends_ids << id.inner_text.to_i }
74
69
  end
75
70
 
71
+ def follower_ids(id = nil)
72
+ endpoint = id ? "/followers/ids/#{id}.xml" : "/friends/ids.xml"
73
+
74
+ doc = request(:get, endpoint, :auth => id ? nil : true) # apparently don't need :auth
75
+ (doc/:ids/:id).inject([]) { |follower_ids, id| follower_ids << id.inner_text.to_i }
76
+ end
77
+
76
78
  def user(id_or_screen_name)
77
79
  doc = request(:get, "/users/show/#{id_or_screen_name}.xml", :auth => true)
78
80
  User.new(doc.at('user'))
@@ -93,7 +95,7 @@ module Tweetsy
93
95
 
94
96
  def build_path(path, params = {})
95
97
  if params.any?
96
- path += "?" + params.inject('') { |str, h| str += "#{h[0].to_s}=#{h[1].to_s}&" }
98
+ path += "?" + params.inject('') { |str, h| str += "#{CGI.escape(h[0].to_s)}=#{CGI.escape(h[1].to_s)}&" }
97
99
  else
98
100
  path
99
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dschn-tweetsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Schneider
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-16 00:00:00 -07:00
12
+ date: 2009-03-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15