json_object_object_add(rq, k, json_object_new_int(v));
}
+void ws_request_add_att_bool(json_object *rq, const char *k, int v)
+{
+ json_object_object_add(rq, k, json_object_new_boolean(v));
+}
+
struct json_object *ws_request_new(const char *op)
{
struct json_object *rq;
int ws_open_session()
{
- int /*version, */result;
+ int version, result;
log_debug("ws_open_session()");
session_id = ws_login();
if (session_id) {
- /*version = ws_get_api_version();
+ version = ws_get_api_version();
log_debug("API version= %d", version);
-
+
if (version > 0) {
result = 1;
} else {
free(session_id);
session_id = NULL;
result = 0;
- }*/
+ }
result = 1;
} else {
result = 0;
rq = ws_request_new("getHeadlines");
ws_request_add_att_int(rq, "feed_id", feed->id);
+ ws_request_add_att_bool(rq, "show_excerpt", 1);
rp = ws_execute(rq);
h = headline_new(hid, url, title);
+ j = json_object_object_get(jheadline,
+ "excerpt");
+ h->excerpt = strdup(json_object_get_string(j));
+
tmp = headlines_add(feed->headlines, h);
if (feed->headlines)
free(feed->headlines);