2 """Robot interface - check URLs from the command line
4 This file is a part of Bookmarks database and Internet robot.
7 __author__ = "Oleg Broytman <phd@phdru.name>"
8 __copyright__ = "Copyright (C) 2010-2012 PhiloSoft Design"
9 __license__ = "GNU GPL"
17 def _setup(self, conn):
18 HTTP._setup(self, conn)
19 self.set_debuglevel(1)
23 from bkmk_objects import Bookmark
24 from Writers.bkmk_wflad import strftime
28 print "Broytman check_url, Copyright (C) 2010 PhiloSoft Design"
31 sys.stderr.write("Usage: check_url.py url1 [url2...]\n")
34 from m_lib.flog import makelog
35 log = makelog("check.log")
37 from robots import robot
40 for url in sys.argv[1:]:
41 bookmark = Bookmark(href=url, add_date=None)
42 bookmark.parent = None
44 rcode = robot.check_url(bookmark)
45 print "check_url: %s" % rcode
47 if hasattr(bookmark, 'error'):
57 """ % (bookmark.href, getattr(bookmark, 'real_title', ''), strftime(bookmark.last_modified), bookmark.icon_href, bookmark.icon)
63 if __name__ == '__main__':