Example #1
0
 public List<Room> rooms() throws IOException {
   List<Room> rooms = connection.get("/rooms.json").parseAs(RoomList.class).rooms;
   for (Room room : rooms) {
     room.setConnection(connection);
   }
   return rooms;
 }
Example #2
0
  public static void getVOSA() throws IOException {

    Document doc;

    // need http protocol
    Connection connection = Jsoup.connect(VOSA_URL);
    connection.timeout(30000);
    doc = connection.get();

    // get all links
    Elements links = doc.select("a.top_link");
    for (Element link : links) {

      // get the value from href attribute
      System.out.println("\nlink : " + link.attr("href"));
      System.out.println("text : " + link.text());
    }
  }
Example #3
0
 public User me() throws IOException {
   return connection.get("/users/me.json").parseAs(SingleUser.class).user;
 }
Example #4
0
 public Account account() throws IOException {
   return connection.get("/account.json").parseAs(SingleAccount.class).account;
 }