Skip to content

Commit ba4ab61

Browse files
feat: Added method for user_show (#26)
1 parent 8783304 commit ba4ab61

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
twitty (0.1.3)
4+
twitty (0.1.4)
55
oauth
66

77
GEM

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Use twitty to register your webhook on twitter as below
4040
$twitter.fetch_webhooks
4141
4242
#register a new webhook
43-
$twitter.register_webhooks(url: "https://xyc.com/webhooks/twitter")
43+
$twitter.register_webhook(url: "https://xyc.com/webhooks/twitter")
4444
```
4545

4646
You should handle the crc checks from twitter by processing the get requests to your webhooks url with a controller method similar to

lib/twitty/constants.rb

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ module Twitty::Constants
9090
method: :post,
9191
endpoint: '/1.1/favorites/destroy.json',
9292
required_params: [:tweet_id]
93+
},
94+
95+
user_show: {
96+
method: :get,
97+
endpoint: '/1.1/users/show.json?screen_name=%<screen_name>s',
98+
required_params: [:screen_name]
9399
}
94100
}.freeze
95101
end

lib/twitty/payload.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Twitty::Payload
44
EMPTY_PAYLOAD_ACTIONS = %w[fetch_webhooks register_webhook unregister_webhook fetch_subscriptions
5-
create_subscription remove_subscription destroy_tweet retweet unretweet].freeze
5+
create_subscription remove_subscription destroy_tweet retweet unretweet user_show ].freeze
66

77
EMPTY_PAYLOAD_ACTIONS.each do |action|
88
define_method "#{action}_payload" do

0 commit comments

Comments
 (0)