Check if Tweet was successful - twitter

On my website I have placed a tweet button. I want to allow Users to Tweet certain content.
So if a user clicks the Tweet Button and tweets - I want to save the Tweet ID in my database.
How do I get the response from Twitter
that the Tweet was successful
what the Tweet id is
Sorry, no clue how to do that. Any Tips where to start?

Related

Some twitter posts have multiple Tweet IDs

I happened to find out that for Tweet post ID (e.g. 804443247653322753), when I try to open the page for this Tweet (through URL like https://twitter.com/PolitiFact/status/804443247653322753), it is automatically redirected to Tweet with different Tweet post ID. (e.g. above link will redirect you to https://twitter.com/PolitiFact/status/804418546168041472). It seems quite many Tweet post IDs can redirect to same single Tweet post. Does anyone know why this happens, or what's wrong with those redirected Tweet post IDs?
As you know, each tweet has an ID.
A RT is a tweet. So a RT has an ID.
The tweet ID 804443247653322753 has been posted by #hrblock_21 and it is a RT of the tweet ID 804418546168041472 posted by #PolitiFact.
So, this is done by twitter, the web site redirects automatically to the original tweet because it is the only tweet to see (except if the user added a comment when retweeting).
And you can even try https://twitter.com/anyUserName/status/804443247653322753, or https://twitter.com/anyUserName/status/804418546168041472, the tweet to see is the original so it redirects.

Tweet button parameters: What does the 'related' parameter do?

According to the official documentation, the related parameter is:
A comma-separated list of accounts related to the content of the shared URI.
But what exactly does it do? When the tweet is sent, the added twitter accounts are never included within the tweet message. And they do not receive a notification either about the tweet.
You will only see the related accounts after you've interacted with the tweet button.
Suggest additional Twitter usernames related to the Tweet as comma-separated values. Twitter may suggest these accounts to follow after the user posts their Tweet. You may provide a brief description of how the account relates to the Tweet with a URL-encoded comma and text after the username.
https://dev.twitter.com/web/tweet-button/web-intent
User hits the button, user posts tweet, user sees the accounts you added in the related field.

Twitter tweet contact widget

Is there a twitter widget to let users on a website tweet at you from a form field on a webpage?
I'm wondering if I could replace a contact form with just a text area field that lets users tweet to my account if users have a twitter account and are logged in.
I don't see any widgets on Twitter website that allow this:
https://dev.twitter.com/web/overview
Apologies if this is not the right forum to post this question.
Thanks!
Jon
You can't present the text field on your site unless you first take the user through the authentication flow to get an access token. For a simple "contact me" situation, it's unlikely many users will want to allow your site to tweet on their behalf.
You can use the Tweet button to popup the Twitter interface with a pre-populated mention using a URL like this:
https://twitter.com/intent/tweet?text=#username

How to post a tweet to Twitter AND get its id

I have the Twitter API installed into a Rails app via this brilliant gem: https://github.com/sferik/twitter. I've been posting some test tweets on my feed and all was fine until I realized that I need to also grab the tweet that is sent out and display it on the site.
Use case: When a user signs up, a tweet is sent out. I'd like to display the tweet that was sent out so that they know they've been tweeted.
Is there anyway I can get the id of a tweet when I do $twitter_api.update(new_user_tweet)?
new_user_tweet would be "We are glad to welcome user12450 to the party!". You get the idea.

how to get a response to know if the user has actually tweeted

i have a webpage. on it, i have added a twitter tweet button, available here
http://twitter.com/about/resources/tweetbutton
using this, the user is able to connect via twitter, and also post tweets. another thing possible is that user clicks on the button, maybe even logs in with twitter, but closes the popup without tweeting.
now, i need to get some kind of response to know when the user has actually tweeted. if the user has tweeted, i have to display a message on my native webpage saying 'thank you for tweeting' and IF POSSIBLE, the tweet text that he tweeted.
any ideas?

Resources