reddit.h - frontends - front-ends for some sites (experiment)
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
reddit.h (727B)
---
1 struct item {
2 char name[16];
3 char title[1024];
4 char url[4096];
5 char permalink[4096];
6 char subreddit[256];
7 char author[256];
8 char thumbnail[4096];
9 long ups;
10 long downs;
11 time_t created_utc;
12 struct tm created_tm;
13 int is_video;
14 long num_comments;
15 long duration;
16 char dash_url[4096];
17 /* flair */
18 char link_flair_text[256];
19 char link_flair_background_color[8];
20 };
21
22 /* Reddit supports max 100 items in their API */
23 #define MAX_ITEMS 100
24
25 struct list_response {
26 struct item items[MAX_ITEMS + 1];
27 size_t nitems;
28 /* tokens */
29 char before[256];
30 char after[256];
31 };
32
33 struct list_response *reddit_list(const char *subreddit, int limit,
34 const char *before, const char *after);
35
36 int reddit_isvalidlink(const char *s);