Skip to content

Commit

Permalink
feat: Added method for user_show (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
thundersparkf authored Oct 8, 2021
1 parent 8783304 commit ba4ab61
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
twitty (0.1.3)
twitty (0.1.4)
oauth

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Use twitty to register your webhook on twitter as below
$twitter.fetch_webhooks
#register a new webhook
$twitter.register_webhooks(url: "https://xyc.com/webhooks/twitter")
$twitter.register_webhook(url: "https://xyc.com/webhooks/twitter")
```

You should handle the crc checks from twitter by processing the get requests to your webhooks url with a controller method similar to
Expand Down
6 changes: 6 additions & 0 deletions lib/twitty/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ module Twitty::Constants
method: :post,
endpoint: '/1.1/favorites/destroy.json',
required_params: [:tweet_id]
},

user_show: {
method: :get,
endpoint: '/1.1/users/show.json?screen_name=%<screen_name>s',
required_params: [:screen_name]
}
}.freeze
end
2 changes: 1 addition & 1 deletion lib/twitty/payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Twitty::Payload
EMPTY_PAYLOAD_ACTIONS = %w[fetch_webhooks register_webhook unregister_webhook fetch_subscriptions
create_subscription remove_subscription destroy_tweet retweet unretweet].freeze
create_subscription remove_subscription destroy_tweet retweet unretweet user_show ].freeze

EMPTY_PAYLOAD_ACTIONS.each do |action|
define_method "#{action}_payload" do
Expand Down

0 comments on commit ba4ab61

Please sign in to comment.