2
* @file ttrss_source.h tt-rss feed list source support
4
* Copyright (C) 2010-2011 Lars Lindner <lars.lindner@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#ifndef _TTRSS_SOURCE_H
22
#define _TTRSS_SOURCE_H
24
#include "fl_sources/node_source.h"
27
* A nodeSource specific for tt-rss
29
typedef struct ttrssSource {
30
nodePtr root; /**< the root node in the feed list */
31
gchar *session_id; /**< the tt-rss session id */
33
gint loginState; /**< The current login state */
34
gboolean selfUpdating; /**< True if remote updating daemon is running */
38
TTRSS_SOURCE_STATE_NONE = 0,
39
TTRSS_SOURCE_STATE_IN_PROGRESS,
40
TTRSS_SOURCE_STATE_ACTIVE
45
* Update only the subscription list, and not each node underneath it.
46
* Note: Uses higher 16 bits to avoid conflict.
48
TTRSS_SOURCE_UPDATE_ONLY_LIST = (1<<16),
50
* Only login, do not do any updates.
52
TTRSS_SOURCE_UPDATE_ONLY_LOGIN = (1<<17)
58
* http://tt-rss.org/redmine/wiki/tt-rss/JsonApiReference
62
* Tiny Tiny RSS Login API
64
* @param user The tt-rss account id
65
* @param passwd The tt-rss account password
67
* @returns {"session_id":"xxx"} or {"error":"xxx"}
69
#define TTRSS_LOGIN_URL "%s/api/?op=login&user=%s&password=%s"
72
* Fetch tt-rss feed list.
74
* @param sid session id
76
* @returns JSON feed list
78
#define TTRSS_SUBSCRIPTION_LIST_URL "%s/api/?op=getFeeds&sid=%s&cat_id=-3"
81
* Fetch tt-rss headlines for a given feed.
83
* @param sid session id
84
* @param feed_id tt-rss feed id
85
* @param limit feed cache size
87
* @returns JSON feed list
89
#define TTRSS_HEADLINES_URL "%s/api/?op=getHeadlines&sid=%s&feed_id=%s&limit=%d&show_content=true&view_mode=all_articles"
92
* Toggle item flag state.
94
* @param sid session id
95
* @param item_id tt-rss item id
96
* @param mode 0 = unflagged, 1 = flagged
98
#define TTRSS_UPDATE_ITEM_FLAG "%s/api/?op=updateArticle&sid=%s&article_ids=%s&mode=%d&field=0"
101
* Toggle item read state.
103
* @param sid session id
104
* @param item_id tt-rss item id
105
* @param mode 0 = read, 1 = unread
107
#define TTRSS_UPDATE_ITEM_UNREAD "%s/api/?op=updateArticle&sid=%s&article_ids=%s&mode=%d&field=2"
110
* Determine server settings.
112
* @param sid session id
114
#define TTRSS_GET_CONFIG "%s/api/?op=getConfig&sid=%s"
117
* Returns ttss source type implementation info.
119
nodeSourceTypePtr ttrss_source_get_type (void);
121
void ttrss_source_login (ttrssSourcePtr source, guint32 flags);
123
extern struct subscriptionType ttrssSourceFeedSubscriptionType;
124
extern struct subscriptionType ttrssSourceSubscriptionType;