I am creating an application which requires twitter account , after I get credentials from an user , I want to check if that account exists or not. How can I do this with twitter4j ??? Note: I am using Google appengine
views:
186answers:
2
Q:
Twitter4j: How to check twitter account exists or not after getting the credentials from an User?
A:
According to the api docs you can pass an email address to the user/ show method, I would assume that if a user didn't exist you'd get back a 404, which should allow you to determine whether or not the user exists.
eg: http://twitter.com/users/[email protected]
result if not exist :
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<request>/users/[email protected]</request>
<error>Not found</error>
</hash
chipeau
2010-05-16 20:04:11
A:
In the new twitter API the email parameter has been deprecated.
Here is something that can use instead: http://api.twitter.com/1/users/show/username.xml
Replace username with the actual user name. If the user is not present, you will get an error message:
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Not found</error>
<request>/1/users/show/asdfsadfasdfasdf.xml</request>
</hash>
Niyaz
2010-10-18 10:11:25