views:

198

answers:

2

Hello all,

I've been using Twitter4J for a quite a while now, but I can't seem to find this particular feature.

I want to be able to search on a name, and when the certain user is on twitter, I want to retrieve basic information such as tweets, followers (like you can access via http) - but how to do is in Twitter4J? Neither the code examples or the source could help me.

Thanks,

William van Doorn

+2  A: 

Look at the following: Twitter4J.api.UserMethods That has the methods you seek. The Twitter class directly implements it.

Woot4Moo
Thanks, and I guess I want .searchUsers() here? Does this work as I expect?EDIT: How do I access these methods? I can't make an instance and they aren't static.
wvd
wvd thats the interface,so obviously you cannot instantiate it. See my edits
Woot4Moo
I don't understand you? Could you give me a fast example of how to use it.
wvd
You want a fast example of the difference between an interface and a class in Java?
Woot4Moo
No, but TwitterFactory().getInstance() gives me a Twitter instance, however if I use .searchUsers() it says that I'm not authorized, this is what I mean. I don't want to authorize -- is this possible?
wvd
I've never used Twitter4J so I honestly don't know. Maybe you should just abide by the security policy set in place instead of trying to be clever about it
Woot4Moo
I'll create a Twitter account and try it then. Thanks, I'll mark this as the answer.
wvd
Thanks, let me know if this does resolve it
Woot4Moo
Thanks, after creating an account it fixed my problem!
wvd
A: 

Hi Wvd, did u find the answer for this ques?

could you please provide the code.

Madhu
please see comments under my answer
Woot4Moo