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"
13 from bkmk_objects import Bookmark
14 from Writers.bkmk_wflad import strftime
24 def _setup(self, conn):
25 HTTP._setup(self, conn)
26 self.set_debuglevel(1)
32 print("Broytman check_url, Copyright (C) 2010-2023 PhiloSoft Design")
35 sys.stderr.write("Usage: check_url.py url1 [url2...]\n")
38 from m_lib.flog import makelog
39 log = makelog("check.log")
41 from robots import robot
44 for url in sys.argv[1:]:
45 bookmark = Bookmark(href=url, add_date=None)
46 bookmark.parent = None
48 rcode = robot.check_url(bookmark)
49 print("check_url: %s" % rcode)
51 if hasattr(bookmark, 'error'):
62 bookmark.href, getattr(bookmark, 'real_title', ''),
63 strftime(bookmark.last_modified), bookmark.icon_href,
70 if __name__ == '__main__':