+static GSList *parse_response(const gchar *response) {
+
+ GSList *result_list = NULL;
+ gint i;
+ gchar **tokens = NULL;
+ WATCInfo *result = NULL;
+
+ /* We split the response into tokens.
+ * - First: before [
+ * - Second: before "
+ * - Third: search term
+ * - Fourth: before,
+ * - Fifth: before [
+ * - Sixth: before "
+ * - Seventh: first actual result
+ * */
+ tokens = g_strsplit_set(response, "[],\"", -1);
+
+ for (i = 4; i < g_strv_length(tokens); i++) {
+ if (strlen(tokens[i])) {
+ result = g_new0(WATCInfo,1);
+ result->movie_name = g_strdup(tokens[i]);
+ result->has_stingers = g_str_has_suffix(tokens[i], "*")
+ || g_str_has_suffix(tokens[i], "?");
+ result_list = g_slist_append(result_list, result);
+ }
+ }
+
+ g_strfreev(tokens);
+
+ return result_list;
+}
+
+void watcinfo_print(WATCInfo *info) {
+
+ g_print("Movie: %s", info->movie_name);
+ g_print(" %s\n", (info->has_stingers) ? "has extra scenes"
+ : "doesn't have extra scenes");
+
+}
+
+void watcinfo_unref(WATCInfo *info) {
+
+ g_free(info->movie_name);
+ g_free(info);
+}
+
+void watcinfo_list_unref(GSList *list) {
+
+ g_slist_foreach(list, (GFunc) watcinfo_unref, NULL);
+ g_slist_free(list);