Twitter follow Url
Hitting the url http://twitter.com/home?status=<status_msg>
takes us to the twitter login page and once logged in, the status is already filled in the input box, ready to be tweeted.
Is there a similar url for following somebody on twitter ?
s开发者_运维问答omething of the form http://twitter.com/follow?user=<user_to be_followed>
so that when this url is hit, the user is taken to login page(if not authenticated), and after a successfull login, the logged in user becomes a follower of the user in the url.
I got information from https://dev.twitter.com/docs/intents#follow-intent
and now you can use https://twitter.com/intent/user?screen_name=<twitter_screen_name>
https://twitter.com/intent/follow?screen_name=[USERNAME]
in fact, there's a few 'intent', this one is particularly useful
https://twitter.com/intent/tweet?text=[TITLE]&url=[URL]
it is much better to use simple links like these for all sharing buttons than the buttons provided by the social sites which will multiply HTTP requests alarmingly.
You could use OAuth. That will direct the user to Twitter for authentication and to authorize your app to act on their behalf. It will then give you a token that you can use to make API calls for that user.
It's not a terribly simple thing to implement and might be more trouble than it's worth for your situation, but the option is there. Look for a library for your platform of choice, they exist for most languages.
I believe it's feasible, but not with a simple url -- you will need to POST data as directed in the friendships/create
method of the Twitter API:
Allows the authenticating users to follow the user specified in the
ID
parameter. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user anHTTP 403
will be returned.
You can't create a link like "follow us!". You can use the Twitter API to make a link that when clicked does the right POST call to the API, but there's no way to obtain a simple link like you asked.
精彩评论