+ j = json_object_object_get(jheadline, "id");
+ hid = json_object_get_int(j);
+ h = feed_get_headline(feed, hid);
+
+ if (!h) {
+ h = malloc(sizeof(struct headline));
+ h->id = hid;
+ h->excerpt = NULL;
+ h->content = NULL;
+ h->title = NULL;
+ h->url = NULL;
+
+ tmp = headlines_add(feed->headlines, h);
+ if (feed->headlines)
+ free(feed->headlines);
+ feed->headlines = tmp;
+ }
+
+ if (!h->title) {
+ j = json_object_object_get(jheadline, "title");
+ h->title = strdup(json_object_get_string(j));
+ }
+
+ if (!h->url) {
+ j = json_object_object_get(jheadline, "link");
+ h->url = strdup(json_object_get_string(j));
+ }
+
+ j = json_object_object_get(jheadline, "unread");
+ h->unread = json_object_get_boolean(j);
+ }
+ err = 0;
+ } else {
+ err = 1;
+ }
+
+ json_object_put(rp);
+ return !err;
+}
+
+const char *ttrss_get_headline_content(struct headline *h)
+{
+ if (!h->content)
+ h->content = ws_get_article_content(h->id);
+
+ return h->content;