summaryrefslogtreecommitdiff
blob: 553d9a88fa84bb308f62fac64582ac967c5e6b0e (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (C) 2009 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GPL 2 or later

import re
FEED_EXTRACTORS = []

def _register_feed_extractor(pattern, format):
    regex = re.compile(pattern)
    FEED_EXTRACTORS.append({'regex':regex, 'format':format})


# git://github.com/dang/kvm.git
# http://github.com/feeds/dang/commits/kvm/master
_register_feed_extractor(
        '^[^ ]+://github.com/([^/]+)/([^/.]+)(?:.git)?$',
        'http://github.com/feeds/\\1/commits/\\2/master')


# git://gitorious.org/gentoo-multimedia/gentoo-multimedia.git
# http://gitorious.org/gentoo-multimedia.atom
_register_feed_extractor(
        '^[^ ]+://gitorious.org/([^/]+)/[^/.]+(?:.git)?$',
        'http://gitorious.org/\\1.atom')

# git://git.overlays.gentoo.org/dev/alexxy.git
# http://git.overlays.gentoo.org/gitweb/?p=dev/alexxy.git;a=atom
_register_feed_extractor(
        '^[^ ]+://git.overlays.gentoo.org/(dev|proj)/([^/.]+)(?:.git)?$',
        'http://git.overlays.gentoo.org/gitweb/?p=\\1/\\2.git;a=atom')

# git://repo.or.cz/dottout.git
# http://repo.or.cz/w/dottout.git?a=rss
_register_feed_extractor(
        '^[^ ]+://repo.or.cz/([^/.]+)(?:.git)?$',
        'http://repo.or.cz/w/\\1.git?a=rss')  # atom broken currently

# http://gentoo-china-overlay.googlecode.com/svn/trunk/
# http://code.google.com/feeds/p/gentoo-china-overlay/svnchanges/basic
_register_feed_extractor(
        '^[^ ]+://([^ ]+).googlecode.com/svn/.*$',
        'http://code.google.com/feeds/p/\\1/svnchanges/basic')

# https://arcon.googlecode.com/hg/
# http://code.google.com/feeds/p/arcon/hgchanges/basic
_register_feed_extractor(
        '^[^ ]+://([^ ]+).googlecode.com/hg/.*$',
        'http://code.google.com/feeds/p/\\1/hgchanges/basic')

# git://git.goodpoint.de/overlay-sping.git
# http://git.goodpoint.de/?p=overlay-sping.git;a=atom
_register_feed_extractor(
        '^[^ ]+://git.goodpoint.de/([^/.]+)(?:.git)?$',
        'http://git.goodpoint.de/?p=\\1.git;a=atom')


# svn://overlays.gentoo.org/proj/toolchain
# http://overlays.gentoo.org/proj/toolchain/timeline
_register_feed_extractor(
        '^svn://overlays.gentoo.org/(dev|proj)/([^/]+)(?:/.*)?$',
        'http://overlays.gentoo.org/\\1/\\2/timeline')