[twitter-dev] Problems about crawling the twitter user relationship

2011-06-13 Thread danny
Hi everyone:

I am going to crawl the user relationship information, like, followers
and friends, from Twitter Inc. for my research work.
While, I am confronted with some problems, can anybody give me some
suggestions.
My problem is as follow:
=
Problem A: I try Twitter4j to fetch the relationship in Twitter .
But I always limit by the rate for not owning a white-list key and
secret, and sometimes I also got some errors, like HTTP 414 Error,
denoting request-URI too large.
Thus, is there any other method to escape the rate limitation with
Twitter API?

Problem B:
For this limit, I attempt another method to get the relationship.
I notice that if I input the url http://twitter.com/!#/dannygao/followers
, I could get the followers of dannygao in browser.
If I input the url http://twitter.com/dannygao/followers, I need to
login first, and then, get the followers in browser.
Thus, I use the AsyncHttpClient to crawl this relationship just like
the process of browser.
The code is as follows:
-
AsyncHttpClient client = new AsyncHttpClient();
Response response = client.prepareGet(this.url).execute().get();
if (response.getStatusCode() == 302) {
System.out.print(Redirecting to... );
String redirect = response.getHeader(Location);
this.url = redirect;
System.out.println(this.url);
response = client.prepareGet(this.url).execute().get();
}
return response.getResponseBody(UTF-8);
-
If I input the url http://twitter.com/!#/dannygao/followers, I got
following output.
 Connecting url http://twitter.com/!#/dannygao/followers
If I input the url http://twitter.com/dannygao/followers, I get
following output.
Connecting url http://twitter.com/dannygao/followers
Redirecting to... 
http://twitter.com/login?redirect_after_login=%2Fdannygao%2Ffollowers

Neither of the scripts I crawled contains the information about user
relationship.
Thus, 1) Can anybody explain what is the difference between these two
urls?
 2) If I want to use this method to crawl the twitter use
relationship, can you provide me some suggestions?
===

Many thanks in advance.

Danny

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


[twitter-dev] Twitter API and Home Presentation - My updates and those of those I follow.

2010-02-16 Thread Danny
As a web developer, I have been tasked with putting up a sidebar on
our website that displays a running set of Tweets that I and those I
follow have made.  I would be happy with the latest 10 to 20 entries,
with possibly a scroll bar for more.

For now, I am looking at Javascript possibilities such as can be found
at:

http://remysharp.com/2007/05/18/add-twitter-to-your-blog-step-by-step/

http://www.webupd8.org/2009/09/create-html-twitter-widget-for-your.html

and others.


Most of these boil down to using some form of the Twitter API.  I can
get them to work, but I am not obtaining the desired results.  The
results seem to be either getting just my Tweets or the Tweets of one
or more of those I follow.  I would like to get both at the same time,
the latest first.

Looking at:

http://apiwiki.twitter.com/Twitter-API-Documentation

I would think that one of the Timeline methods would get me what I
want.  For example, Twitter REST API Method: statuses/home_timeline
says it Returns the 20 most recent statuses, including retweets,
posted by the authenticating user and that user's friends.

Maybe my problem is understanding the difference between a friend and
someone I am following?

As you can see, I am not an experienced twitterer.

Thanks for any help,

Danny



Storing twitter info on my database

2009-01-11 Thread danny

I just want to be clear.

Is it cool if I store data coming from the twitter API and store it on
my own database? (messages, twits, etc.)?

I find the API rate limit of 100 an hour too restrictive.