File: spider.py

package info (click to toggle)
planet-venus 0~bzr95-2+lenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,616 kB
  • ctags: 1,981
  • sloc: python: 14,776; xml: 821; makefile: 36; sed: 3
file content (22 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
"""
Main program to run just the spider portion of planet
"""

import sys
from planet import spider, config

if __name__ == '__main__':

    config.load(sys.argv[1])

    if len(sys.argv) == 2:
        # spider all feeds 
        spider.spiderPlanet()
    elif len(sys.argv) > 2:
        # spider selected feeds 
        for feed in sys.argv[2:]:
            spider.spiderFeed(feed)
    else:
        print "Usage:"
        print "  python %s config.ini [URI URI ...]" % sys.argv[0]