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