summaryrefslogtreecommitdiff
path: root/rss.c
diff options
context:
space:
mode:
Diffstat (limited to 'rss.c')
-rw-r--r--rss.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/rss.c b/rss.c
index b31ffd3..ce3e184 100644
--- a/rss.c
+++ b/rss.c
@@ -110,6 +110,9 @@ xs_str *rss_from_timeline(snac *user, const xs_list *timeline,
110void rss_to_timeline(snac *user, const char *url) 110void rss_to_timeline(snac *user, const char *url)
111/* reads an RSS and inserts all ActivityPub posts into the user's timeline */ 111/* reads an RSS and inserts all ActivityPub posts into the user's timeline */
112{ 112{
113 if (!xs_startswith(url, "https:/") && !xs_startswith(url, "http:/"))
114 return;
115
113 xs *hdrs = xs_dict_new(); 116 xs *hdrs = xs_dict_new();
114 hdrs = xs_dict_set(hdrs, "accept", "application/rss+xml"); 117 hdrs = xs_dict_set(hdrs, "accept", "application/rss+xml");
115 hdrs = xs_dict_set(hdrs, "user-agent", USER_AGENT); 118 hdrs = xs_dict_set(hdrs, "user-agent", USER_AGENT);
@@ -204,10 +207,9 @@ void rss_to_timeline(snac *user, const char *url)
204} 207}
205 208
206 209
207void rss_process(void) 210void rss_poll_hashtags(void)
208/* parses all RSS from all users */ 211/* parses all RSS from all users */
209{ 212{
210#if 0
211 xs *list = user_list(); 213 xs *list = user_list();
212 const char *uid; 214 const char *uid;
213 215
@@ -215,7 +217,7 @@ void rss_process(void)
215 snac user; 217 snac user;
216 218
217 if (user_open(&user, uid)) { 219 if (user_open(&user, uid)) {
218 const xs_list *rss = xs_dict_get(user.config, "rss"); 220 const xs_list *rss = xs_dict_get(user.config, "followed_hashtags");
219 221
220 if (xs_is_list(rss)) { 222 if (xs_is_list(rss)) {
221 const char *url; 223 const char *url;
@@ -227,5 +229,4 @@ void rss_process(void)
227 user_free(&user); 229 user_free(&user);
228 } 230 }
229 } 231 }
230#endif
231} 232}