1 #! /usr/bin/env python3
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-2023 PhiloSoft Design"
9 __license__ = "GNU GPL"
14 from bkmk_objects import Bookmark
15 from Writers.bkmk_wflad import strftime
21 def _setup(self, conn):
22 HTTP._setup(self, conn)
23 self.set_debuglevel(1)
30 print("Broytman check_url, Copyright (C) 2010-2023 PhiloSoft Design")
33 sys.stderr.write("Usage: check_url.py url1 [url2...]\n")
36 from m_lib.flog import makelog
37 log = makelog("check.log")
39 from robots import robot
42 for url in sys.argv[1:]:
43 bookmark = Bookmark(href=url, add_date=None)
44 bookmark.parent = None
46 rcode = robot.check_url(bookmark)
47 print("check_url: %s" % rcode)
49 if hasattr(bookmark, 'error'):
60 bookmark.href, getattr(bookmark, 'real_title', ''),
61 strftime(bookmark.last_modified), bookmark.icon_href,
68 if __name__ == '__main__':