Is there a way to check if a twitter username exists? Without being authenticated with OAuth or the twitter basic authentication?
相关问题
- java client program to send digest authentication
- PHP persistent login - Do i reissue a cookie after
- Rails how to handle error and exceptions in model
- How to handle “App is temporarily blocked from log
- Script fails on SpreadsheetApp.openById - Requires
相关文章
- is there a callback option with twitter's “fol
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- SwiftUI - Vertical Centering Content inside Scroll
- Override UserManager in django
- Proper WWW-Authenticate header for OAuth provider
- Your application has authenticated using end user
- Twitter name length in DB
- Twitter oauth refresh token
You can try to grab the
http://twitter.com/username
page and read the response to see if you get the "Sorry, that page doesn’t exist!" page.Edit:
As @Pablo Fernandez mentioned in a comment, it will be better (faster, more reliable) to check the response header, which will be "404 not-found" if the user doesn't exist.
You can try:
As of right now, you're better off using the API the signup form uses to check username availability in realtime. Requests are of the format:
And give you a JSON response with a
valid
key giving you a true if the username can be registered:The reason this is better than checking for 404 responses is that sometimes words are reserved (like 'root' above), or a username is actually taken but for some reason the account is gone from the Twitter front end.