tweetkit icon indicating copy to clipboard operation
tweetkit copied to clipboard

Calling .tweet like documentation returns error

Open ishields opened this issue 3 years ago • 5 comments

Hello, first off, great job so far. I am just getting started with the twitter api and had a hard time figuring it out. Seems like we're in a transition from oauth 1.a to 2 and v1 to v2. The documentation on twitter is a little all over the place. Anyway, your gem is saving me a lot of time, so thank you.

So when I first started to test this gem I noticed that if you follow the documentation and call

  response = client.tweet(1234567890)

you get an error "wrong number of arguments".

I then realized that the version "v0.1.4 " is missing a lot, so I switched to

gem 'tweetkit', git: '[email protected]:julianfssen/tweetkit.git', ref: '0284331' #allows posting to twitter

The error persisted though. Looked into the code a bit and realized the options were not optional and I had to pass in a empty {}

response = client.tweet(1234567890, *{})

I know this gem is in dev, but figured it might help to point this out.

  1. Probably should make the options optional or specify they are't optional in the documentation. The syntax of having to *{} isn't ideal.

  2. Does it make sense to make a new tag with the latest functionality? What I needed was the .post_tweet functionality so I switched to that specific ref.

ishields avatar Dec 19 '21 22:12 ishields

Hey @ishields ! Thanks for trying out the gem!

I apologize for the slow response and also slow development of the gem as I've been caught up with work for awhile.

Regarding your questions:

  1. Can you let me know the Ruby version you're using? I'll need to check how **args works for different Ruby versions which I think is the cause of the issue (as you mentioned). Ideally, for the next release I'm also going to setup Github actions to automatically run our specs for multiple Ruby versions. I'll fix this issue.

  2. Yes, it definitely makes sense to release a new tag for the latest functionalities merged in the last few months. I'm planning to release it by the end of this month in the first week of January, right after I'm done with some work stuffs I have on hand. In the meantime, is it OK for you to use the Github ref first? I'm sorry again for the poor experience.

Anyways, thanks for reporting this issue to me! I'll work on it and yeah, feel free to leave more feedback if you have any, @ishields ! Thanks and merry Xmas in advance!

julianfssen avatar Dec 21 '21 02:12 julianfssen

@julianfssen Sorry for the slow reply. No problem at all! Appreciate all that you do and thanks for your quick response.

  1. Using ruby '3.0.0'
  2. Yes I can use the ref. Here is what I currently use.
gem 'tweetkit', git: '[email protected]:julianfssen/tweetkit.git', ref: '0284331' 

ishields avatar Dec 31 '21 14:12 ishields

Hey, Ian! @ishields , I've released a new version of the gem a couple of weeks ago. There's a bug in that release re: the Faraday gem, however, so you can try out the gem from the master branch instead. I apologize again for not being able to use the RubyGems release, hopefully I'll fix this issues soon. Let me know if anything comes up when trying it, Ian!

julianfssen avatar Jan 20 '22 15:01 julianfssen

FYI 0.2 works fine as documented, so this can probably be closed.

thoraxe avatar Mar 22 '22 17:03 thoraxe

lets close this

jtoy avatar Dec 16 '22 14:12 jtoy