public class TwitterAPI { // Twitter idとscreen_nameの対応に関するキャッシュ private HashMap cache_id_screen_name = new HashMap(); private HashMap cache_screen_name_id = new HashMap(); String cache_filename = "cache_id_screen_name.txt"; // follower, followingに関するキャッシュ private HashMap cache_id_followers = new HashMap(); private HashMap cache_id_friends = new HashMap(); // Twitterに送信した要求の数 private int api_req_count = 0; public TwitterAPI(){ loadCache(); } public boolean loadCache(){ String[] strs = loadStrings(cache_filename); if(strs != null){ for(int cnt=0;cnt findTimeline(PApplet applet,String screen_name){ Vector statuses = new Vector(); // TwitterのURL String url = "http://twitter.com/statuses/user_timeline/"+screen_name+".xml"; api_req_count++; try{ XMLElement xml = new XMLElement(applet,url); int count = xml.getChildCount(); String old_text = null; for(int cnt=0;cnt