-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetect.h
More file actions
42 lines (34 loc) · 1.09 KB
/
Copy pathdetect.h
File metadata and controls
42 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* See LICENSE file for copyright and license details. */
#ifndef DETECT_H
#define DETECT_H
/* Detected site/CMS types */
typedef enum {
SITE_UNKNOWN,
SITE_WORDPRESS,
SITE_BLOGGER,
SITE_HUGO,
SITE_JEKYLL,
SITE_GHOST,
SITE_DRUPAL,
SITE_MEDIAWIKI
} SiteType;
/* Detection result with hints for archiving */
typedef struct {
SiteType type;
const char *name; /* human-readable CMS name */
char *feed_url; /* RSS/Atom feed URL if found */
char *api_url; /* REST API base if found */
char *sitemap_url; /* sitemap.xml URL if found */
int has_json_api; /* site has a JSON API */
} SiteInfo;
/* Detect CMS type from HTML and URL */
SiteInfo *detect_site(const char *html, const char *url);
/* Free detection result */
void siteinfo_free(SiteInfo *info);
/* Get sitemap URLs for a detected site */
char **detect_sitemap_urls(SiteInfo *info, const char *domain,
int *count);
/* Get additional seed URLs based on CMS type */
char **detect_seed_urls(SiteInfo *info, const char *domain,
int *count);
#endif /* DETECT_H */