private MovieSource.ReceiveMovieFunction _get_callback;
char *current;
string cinema_name;
+ public string location;
MovieFilter _filter;
PatternSpec pattern;
public void parse (ref char[] buf) throws Error {
current = buf;
next_tag ();
-
- {
+ while (location == null && current[0] != 0) {
int i = 1;
while (current[i++] != '>');
if (((string) current).has_prefix ("<a href=\"/movies?near=")) {
- weak string href = parse_tag_attribute ("a", "href").offset (13); // "/movies?near=" ->"berlin&date=1"
- // TODO - extract location and cache it
+ string href = parse_tag_attribute ("a", "href");
+ char* p = (char*) href.offset (13); // skip "/movies?near="
+ int j = -1;
+
+ while (p[++j] != '&' && p[j] != 0);
+ p[0] = p[0].toupper ();
+ location = ((string) p).ndup (j);
}
current += i;
next_tag ();