Example #1
0
 public Vector search(String query, int page) throws Exception {
   try {
     SearchResultsParser parser = new SearchResultsParser();
     String url = SEARCH_URL + StringUtil.urlEncode(query) + "&page=" + page;
     Log.debug("URL: " + url);
     HttpUtil.doPost(url, parser);
     Vector statuses = parser.getStatuses();
     return statuses;
   } catch (Exception ex) {
     throw new Exception("Error while searching tweets: " + ex.getMessage());
   }
 }
Example #2
0
  public Vector requestLists() throws Exception {
    authorize();

    Vector entries = new Vector();
    try {
      ListsParser parser = new ListsParser();
      String url = StringUtil.replace(LISTS_URL, "@USERNAME@", username);
      xauth.xAuthWebRequest(false, url, null, parser);
      // HttpUtil.doGet(url, parser);
      entries = parser.getUserLists();
    } catch (IOException ex) {
      throw new IOException("Error in TwitterApi.requestLists: " + ex.getMessage());
    } catch (Exception ex) {
      throw new Exception("Error in TwitterApi.requestLists: " + ex.getMessage());
    }
    return entries;
  }
Example #3
0
 public Vector requestListStatuses(String listName) {
   String url = StringUtil.replace(LIST_STATUSES_URL, "@LIST@", StringUtil.urlEncode(listName));
   url = StringUtil.replace(url, "@USERNAME@", username);
   System.out.println("Loading custom URL: " + url);
   return requestTimeline(url);
 }