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; }
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()); } }
public User me() throws IOException { return connection.get("/users/me.json").parseAs(SingleUser.class).user; }
public Account account() throws IOException { return connection.get("/account.json").parseAs(SingleAccount.class).account; }