2

I am using the twitter gem to update a users status. However, I also need to know the ID of the recently created status so I can delete it later on. Any guidance here?

John R
  • 301
  • 3
  • 14

2 Answers2

6

Assuming you've properly configured your Twitter client, it should be as easy as:

# Create a tweet
tweet = Twitter.update("I'm tweeting with @gem!")

# Delete that tweet
Twitter.status_destroy(tweet.id)
sferik
  • 1,795
  • 2
  • 15
  • 22
2

You should be able to reference the id by simply appending '.id' to the returned tweet. e.g. Twitter.status(27558893223).id

Cronin O'M
  • 692
  • 1
  • 12
  • 19