catalog.py 597 Bytes
Newer Older
1
2
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
3

rgaudin's avatar
rgaudin committed
4
import requests
thiolliere's avatar
thiolliere committed
5
import yaml
thiolliere's avatar
thiolliere committed
6

rgaudin's avatar
rgaudin committed
7
CATALOGS = [
8
9
10
11
12
13
14
15
16
17
    {
        "name": "Kiwix",
        "description": "Kiwix ZIM Content",
        "url": "http://download.kiwix.org/library/ideascube.yml",
    },
    {
        "name": "StaticSites",
        "description": "Static sites",
        "url": "http://catalog.ideascube.org/static-sites.yml",
    },
18
19
]

rgaudin's avatar
rgaudin committed
20
21
22
YAML_CATALOGS = []
try:
    for catalog in CATALOGS:
23
24
25
        YAML_CATALOGS.append(
            yaml.load(requests.get(catalog.get("url")).content.decode("utf-8"))
        )
rgaudin's avatar
rgaudin committed
26
27
except Exception:
    pass