Some twitter posts have multiple Tweet IDs - twitter

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.

Related

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.

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.

Check if Tweet was successful

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?

Twitter "status update" url not working on iOS

I've added a "tweet this" link to a site. It uses the url to update your Twitter status (if you're signed in). Basic version is as follows:
Twitter
You can see it in action here - http://jsfiddle.net/CXzf9/1/ - right click the link to open in a new window (need to be logged in to Twitter first).
Works fine except on iOS devices. Then it gives you an error saying "Sorry that page doesn't exist". You can also see this using Safari when set to the iPad user agent. It redirects from
http://twitter.com/home/?status=TEST STATUS
to
https://mobile.twitter.com/home/?status=TEST STATUS
But it's not that causing the problem, as if you visit that link in Safari (with the usual user agent) you get the mobile version, but it's still allowing you to update your status.
Is this some iOS restriction?
UPDATE - VISUAL EXPLANATION:
This is visiting mobile link in Safari:
This is same link with user agent set to iPad:
OK, seems it works if you use the following url:
https://twitter.com/intent/tweet?text=
So original code would be:
Twitter
Must be some iOS restriction on updating a status for some reason.
after trying on my iPad, I got undefined as the title and text saying "something went wrong". if this is what you are receiving, then it's because twitter does not have a mobile version of this page. Hence "mobile.twitter.com". I would recommend using the twitter api (here) to update a uses status.
Official Twitter documentation about creating post links:
https://dev.twitter.com/web/tweet-button/web-intent
Web Intent URL
https://twitter.com/intent/tweet
Query parameters
text (optional)
Pre-populated UTF-8 and URL-encoded
Tweet text. The passed text will appear pre-selected for a Twitter
user to delete or edit before posting.
The length of your passed Tweet text should not exceed 140 characters
when combined with any passed hashtags, via, or url parameters. Passed
Tweet text which causes the Tweet to exceed 140 characters in length
will require additional editing by a Twitter user before he or she can
successfully post.
Example Value: Hello%20World
url (optional)
A fully-qualified URL with a HTTP or HTTPS scheme,
URL-encoded. The provided URL will be shortened with Twitter’s t.co to
the number of characters specified by short_url_length.
Example Value: http:%3A%2F%2Fexample.com%2F
hashtags (optional)
Allow easy discovery of Tweets by topic by including
a comma-separated list of hashtag values without the preceding #
character.
Example Value: nature,sunset
via (optional)
A Twitter username to associate with the Tweet, such as
your site’s Twitter account. The provided username will be appended to
the end of the Tweet with the text “via #username”.
A logged-out Twitter user will be encouraged to sign-in or join
Twitter to engage with the via account’s Tweets. The account may be
suggested as an account to follow after the user posts a Tweet
Example Value: twitterdev
related (optional)
Suggest additional Twitter usernames related to the
Tweet as comma-separated values. Twitter may suggest these accounts to
follow after the user posts his or her 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.
Example Value:
twitter%3ATwitter%20News,twitterapi%3ATwitter%20API%20News
in-reply-to (optional)
The Tweet ID of a parent Tweet in a conversation,
such as the initial Tweet from your site or author account.
Example Value: 525001166233403393
Example post link: https://twitter.com/intent/tweet?text=Hello%20World&via=twitterdev

Twitter: Include The Tweet ID In The Query String of a URL In The Tweet

I am trying to create a URL that will be shared in a tweet that references the tweet that it is included in, so that the page the URL is referencing can refer back to the original tweet.
I know this is a bit of a chicken and egg question, since the Tweet ID doesn't exist until the tweet is created, but I was hoping twitter had some kind of 'tweet id token' that I can include in the tweet that will be replaced by Twitter once the tweet is created. I've looked through the API as best as I could and have not been able to find any such feature.
Am I missing something, or has someone found another way to accomplish this?
The statuses/update endpoint does return the new tweet and that new tweet does have the new id. If you wait for the call to return, you can grab the id and then build the URL.

Resources