views:

300

answers:

4
+1  Q: 

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 ?

something 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.

A: 

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 an HTTP 403 will be returned.

artlung
I dont want to ask the user for his/her username and password. I want the user to be authenticated by twitter itself. Looks like there is no available url to do that !
letronje
A: 

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.

Napolux
+1  A: 

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.

Jason Diller