[twitter-dev] How to check specific user is in my list?

2010-07-26 Thread Nara
Now I'm using GET list members id method to check user is a member of
the specified list.

But if user has a lot of list, this method takes a long time to check.
(because it requires one request to check one list)

anyone have any better ideas about this problem?


[twitter-dev] How to check

2010-05-21 Thread Lintang Milyar
Are there any ways to do checking, authenticating and authorizing
Twitter API like how Facebook does?

I want to develop a form (using PHP) where my visitors could update
their Twitter through my application (API), but right now before they
could update it, they must authorize my application first even they
already authorize it before. It seems a little annoying.

Then I tried API @anywhere, but sometimes it won't start. I don't know
why.. And it seems not compatible with mobile browser (I tested using
iPhone's Safari).

So, is there any solutions or API class that I could use with my
application (PHP), so my users could update their Twitter using my
form and API without must re-authorizing my API first?

Thanks for your help guys.



[twitter-dev] How to check the access tokens before directing to a sign in /allow, deny page?

2010-05-06 Thread Chathura
Hi,
I have a twitter application and I want to check the following
scenario.

A user logged into his twitter account and already granted permissions
to make status notes through another application.
When user hits the connect button, the navigation directs to Allow/
Deny page which he already confirmed. I want this to by pass and
automatically allowed the user to update the status notes in their
twitter wall.

I used the following code and it doesn't work as expected. Could you
please help me to solve this?

const string requestUrl = http://twitter.com/oauth/request_token;;

// This is the URL to exchange the request token for an
access token
const string accessUrl = http://twitter.com/oauth/
access_token;

// This is the URL to access a protected resource; in this
case,
// the authorized user’s timeline
const string userTimeline = http://twitter.com/statuses/
user_timeline.xml;

// This is your application’s consumer key
const string key = key;

// This is your application’s consumer secret
const string secret = secret;

// This is the URL to send a user for authorization
const string authorizeUrl = http://twitter.com/oauth/
authorize?oauth_token=;

// Retrieve and parse the request token
var response = OAuth.GetRequestToken(requestUrl, key,
secret);
var collection = HttpUtility.ParseQueryString(response);
var requestToken = new { Token = collection[0],
TokenSecret = collection[1] };

// At this point, your application must wait for the user
to return
var url = String.Concat(authorizeUrl,
 
Uri.EscapeDataString(requestToken.Token));

string value = OAuth.GetAccessToken(accessUrl,
key,
secret,
access token of a
user,// this is a unique value for a user
access token secret of
the user); // unique value for a user

// above method doesn't give me the the required value in fact, it
gives an error calledthis method needs to call with request
tokens


 I want the following 4 lines of code to be executed only if the
user hasn't granted permissions or not logged in   

Process proc = new Process();
proc.StartInfo.FileName = iexplore;
proc.StartInfo.Arguments = url;
proc.Start();


// Exchange the request token for the access token after
user approval
response = OAuth.GetAccessToken(accessUrl,
key,
secret,
requestToken.Token,
requestToken.TokenSecret);

while (String.IsNullOrEmpty(response.Trim()))
{
response = OAuth.GetAccessToken(accessUrl,
key,
secret,
requestToken.Token,
requestToken.TokenSecret);
}


if (response.Contains(screen_name))
{

collection = HttpUtility.ParseQueryString(response);

var accessToken = new { Token = collection[0],
TokenSecret = collection[1] };

// Get the user timeline using OAuth credentials
response = OAuth.GetProtectedResource(userTimeline,
  GET,
  key,
  secret,
 
accessToken.Token,
 
accessToken.TokenSecret);


OAuthTokens accToken = new OAuthTokens();
accToken.AccessToken = collection[0].ToString();
accToken.AccessTokenSecret = collection[1].ToString();
accToken.ConsumerKey = key;
accToken.ConsumerSecret = secret;

TwitterStatus TweetStatus = new
TwitterStatus(accToken);
TweetStatus.Update(test message);
}


[twitter-dev] How to Check for Banned IP

2009-08-17 Thread Aaron Forgue
I believe that my Twitter application's API requests are being
blocked/banned as a result of the recent DoS mitigation steps. Who should I
contact to find out for sure?