]> git.phdru.name Git - bookmarks_db.git/blobdiff - check_url.py
Fix(Robot): Stop splitting and un-splitting URLs
[bookmarks_db.git] / check_url.py
diff --git a/check_url.py b/check_url.py
deleted file mode 100755 (executable)
index 2da9d4d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /usr/bin/env python3
-"""Robot interface - check URLs from the command line
-
-This file is a part of Bookmarks database and Internet robot.
-"""
-
-__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2010-2023 PhiloSoft Design"
-__license__ = "GNU GPL"
-
-import sys
-import httplib
-
-from bkmk_objects import Bookmark
-from Writers.bkmk_wflad import strftime
-
-HTTP = httplib.HTTP
-
-
-class MyHTTP(HTTP):
-    def _setup(self, conn):
-        HTTP._setup(self, conn)
-        self.set_debuglevel(1)
-
-
-httplib.HTTP = MyHTTP
-
-
-def run():
-    print("Broytman check_url, Copyright (C) 2010-2023 PhiloSoft Design")
-
-    if len(sys.argv) < 2:
-        sys.stderr.write("Usage: check_url.py url1 [url2...]\n")
-        sys.exit(1)
-
-    from m_lib.flog import makelog
-    log = makelog("check.log")
-
-    from robots import robot
-    robot = robot(log)
-
-    for url in sys.argv[1:]:
-        bookmark = Bookmark(href=url, add_date=None)
-        bookmark.parent = None
-
-        rcode = robot.check_url(bookmark)
-        print("check_url: %s" % rcode)
-
-        if hasattr(bookmark, 'error'):
-            print(bookmark.error)
-
-        else:
-            print("""\
-  URL: %s
-  Title: %s
-  LastModified: %s
-  IconURI: %s
-  Icon: %s
-  """ % (
-              bookmark.href, getattr(bookmark, 'real_title', ''),
-              strftime(bookmark.last_modified), bookmark.icon_href,
-              bookmark.icon))
-
-    robot.stop()
-    log.close()
-
-
-if __name__ == '__main__':
-    run()