return result;
}
- public async List<Lift>? get_lift_list (string city_from, int radius_from, string city_to, int radius_to, Date date, int tolerance = 0) {
+ public string? get_lift_list_url (string city_from, int radius_from, string city_to, int radius_to, Date date, int tolerance = 0) {
if (city_list == null)
get_city_list ();
int num_from = get_city_number (city_from);
- if (num_from == 0) {
- stderr.printf ("Unknown city: %s\n", city_to);
+ if (num_from == 0)
return null;
- }
int num_to = get_city_number (city_to);
- if (num_to == 0) {
- stderr.printf ("Unknown city: %s\n", city_to);
+ if (num_to == 0)
return null;
- }
string url = HTTP_BASE_URI + "/mitfahrclub/%s/%s/b.html".printf (
city_from,
tolerance
);
- var doc = yield get_html_document (url);
+ return url;
+ }
+
+ public async List<Lift>? get_lift_list (string city_from, int radius_from, string city_to, int radius_to, Date date, int tolerance = 0) {
+ var doc = yield get_html_document (get_lift_list_url (city_from, radius_from, city_to, radius_to, date, tolerance));
if (doc == null) {
stderr.printf ("Error: parsing failed\n");
return null;
return lift;
}
- public async bool update_lift_details (Lift lift) {
- string url = HTTP_BASE_URI + lift.href;
+ public string get_lift_details_url (Lift lift) {
+ return HTTP_BASE_URI + lift.href;
+ }
- var doc = yield get_html_document (url);
+ public async bool update_lift_details (Lift lift) {
+ var doc = yield get_html_document (get_lift_details_url (lift));
if (doc == null) {
stderr.printf ("Error: parsing failed\n");
return false;
return true;
}
- public async MyInformation get_my_information () {
- string url = HTTPS_BASE_URI + "/users/view";
+ public string get_my_information_url () {
+ return HTTPS_BASE_URI + "/users/view";
+ }
- var doc = yield get_html_document (url);
+ public async MyInformation get_my_information () {
+ var doc = yield get_html_document (get_my_information_url ());
if (doc == null) {
stderr.printf ("Error: parsing failed\n");
return null;