- struct json_object *rp, *rq, *content, *jfeed, *j;
+ struct json_object *rp, *rq, *content, *array, *item;
+
+ printf("get_headlines %d\n", h->id);
+
+ if (!h->content) {
+ rq = create_op("getArticle");
+ json_object_object_add(rq, "article_id",
+ json_object_new_int(h->id));
+
+ rp = http_json_get(session_url, rq);
+
+ json_object_put(rq);
+
+ array = json_object_object_get(rp, "content");
+
+ if (!array)
+ goto release;
+
+ item = json_object_array_get_idx(array, 0);
+
+ if (!item)
+ goto release;
+
+ content = json_object_object_get(item, "content");
+
+ h->content = strdup(json_object_get_string(content));
+
+ release:
+ json_object_put(rp);
+ }
+ return h->content;
+}
+
+static struct headline **get_headlines(int feed_id)
+{
+ struct json_object *rp, *rq, *content, *jheadline, *j;