EOF
}
+public class Cinema {
+ public string name;
+ public string address;
+ public string phone;
+
+ public Cinema (string _name) {
+ name = _name;
+ }
+}
+
public class GoogleMovie : Movie {
- public string cinema;
+ public Cinema cinema;
public string runtime;
public string fsk;
public string showtimes;
public class GoogleParser : Object {
private MovieSource.ReceiveMovieFunction _get_callback;
char *current;
- string cinema_name;
+ Cinema last_cinema;
public string location;
MovieFilter _filter;
PatternSpec pattern;
movie.year = 0;
movie.rating = (int) (rating * 10);
- movie.cinema = cinema_name;
+ movie.cinema = last_cinema;
if (runtime_and_fsk.length >= 2) {
movie.runtime = runtime_and_fsk[0];
movie.fsk = runtime_and_fsk[1];
// TODO - could be configurable by settings
if (movie.runtime != null)
- movie.secondary = "%s - %s - %s".printf (movie.runtime, cinema_name, showtimes);
+ movie.secondary = "%s - %s - %s".printf (movie.runtime, last_cinema.name, showtimes);
else
- movie.secondary = "%s - %s".printf (cinema_name, showtimes);
+ movie.secondary = "%s - %s".printf (last_cinema.name, showtimes);
_get_callback (movie);
}
expect_tag ("/h2");
expect_tag ("div"); // class=info
var address_and_phone = parse_text ().replace (" ", " ").split (" - ");
+ string address = null;
+ string phone = null;
if (address_and_phone.length >= 2) {
- // string address = address_and_phone[0];
- // string phone = address_and_phone[1];
+ address = address_and_phone[0];
+ phone = address_and_phone[1].replace (" ", "").replace ("-", "");
}
expect_tag ("a"); // target=_top
expect_tag ("/a");
expect_tag ("/div");
expect_tag ("/div");
- cinema_name = name;
- // FIXME - store cinema address for movie detail window
+ last_cinema = new Cinema (name);
+ last_cinema.address = address;
+ last_cinema.phone = phone;
}
public void parse (ref char[] buf) throws Error {
runtime = 7200;
}
- res = Calendar.add_event (movie.title, _("Movie"), movie.cinema, showtime, showtime + runtime);
+ res = Calendar.add_event (movie.title, _("Movie"), movie.cinema.name, showtime, showtime + runtime);
var banner = (Banner) Banner.show_information_with_markup (window, null, (res == 0) ?
_("Added calendar event at %d:%02d").printf (hour, min) :
_("Failed to add calendar event"));