The friendship APIs really don't have much to do with OAuth at all -- OAuth
is just a means to communicate authority and state (who the current user and
application "are").

Though the response is sometimes cached (and not absolutely up to date),
this API call is what you're looking for:

http://api.twitter.com/1/friendships/show.json?source_screen_name=#{source_screen_name}&target_screen_name=#{target_screen_name}

Example response when called with source_screen_name=episod and
target_screen_name=twitterapi:
{"relationship"=>{"target"=>{"id"=>819797, "screen_name"=>"episod",
"following"=>true, "followed_by"=>true}, "source"=>{"blocking"=>nil,
"all_replies"=>nil, "want_retweets"=>nil, "id"=>6253282, "marked_spam"=>nil,
"screen_name"=>"twitterapi", "notifications_enabled"=>nil,
"following"=>true, "followed_by"=>true}}}

Which amounts to a bi-directional following relationship.

In PHP twitteroauth, this would probably be something like:
$content = $connection->get('friendships/show',
array('source_screen_name'=>'episod',
'target_screen_name'=>'twitterapi'));

Thanks,
Taylor

On Tue, Sep 28, 2010 at 7:34 AM, Rick Stuivenberg <rickstuivenb...@gmail.com
> wrote:

> Hello,
>
> What are the oauth functions to check if somebody is following me or
> not? I am currently making a script to check up if a user is following
> me, and if so, following them back, and if not, unfollow the user.
>
> Can somebody give me a point in the direction what oauth functions I
> need?
>
> btw; I am using twitteroauth.
>
> Rick
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to