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

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.

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.

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

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

Making a link that generates a tweet on Twitter

I've just looked online but couldn't find the answer:
Is it possible to include a link in an HTML e-mail, so that when a user clicks it, it takes them to post a pre-defined text on their Twitter account, e.g. "#username #hashtagterm This text comes up automatically for me to tweet"?
I guess that if a user isn't logged in, they'll have to go past the login screen and then arrive at the page where they can send the tweet, right?
As I said, it needs to work reliably in an email, so I guess it shouldn't have any javascript associated with it.
Thanks for any help.
Try this, replacing the text with what you want:
https://twitter.com/intent/tweet?text=this+is+a+test
See intents

Default value of 'From:' field in TWTweetComposeViewController

If a user has >1 Twitter accounts set up of their device, I would like to be able to control which account username is the default value of the From field in TWTweetComposeViewController.
At the moment it seems to default to the first Twitter account on the system and I can see no way of changing this.
As far as I know, i't not possible to manipulate TWTweetComposeViewController more than adding an image, a link and an initial text. Apple is very clear on this:
Although you may perform Twitter requests on behalf of the user, you
cannot append text, images, or URLs to tweets without the user’s
knowledge. Hence, you can set the initial text and other content
before presenting the tweet to the user but cannot change the tweet
after the user views it
I know that preselecting the user account it's not against it, but on the class reference I don't see a way to change the account. It's completly up to the user.
http://developer.apple.com/library/ios/#DOCUMENTATION/Twitter/Reference/TWTweetSheetViewControllerClassRef/Reference/Reference.html
I have a problem similar. I'm trying to fetch which account was used after the tweet. TWTweetComposeViewController seems to remember which was the last account used to tweet. If anyone knows...

Resources