"""
-   Simple, strightforward robot; guaranteed to has problems with timeouts :)
+   Simple, strightforward robot
 
-   Written by BroytMann, Mar 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design
+   Written by Oleg BroytMann. Copyright (C) 2000-2007 PhiloSoft Design.
 """
 
 
+import string, os
+import time, urllib
+from urlparse import urljoin
+from m_lib.net.www.util import parse_time
+from m_lib.md5wrapper import md5wrapper
+
+
 class RedirectException(Exception):
    reloc_dict = {
       301: "perm.",
       Exception.__init__(self, "(%s) to %s" % (self.reloc_dict[errcode], newurl))
 
 
-import string, os
-import time, urllib
-from m_lib.net.www.util import parse_time
-from m_lib.md5wrapper import md5wrapper
-
-
 class MyURLopener(urllib.URLopener):
    # Error 302 -- relocated (temporarily)
    def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): 
                            raise RedirectException("html", "Bad redirect to %s (%s)" % (url, refresh))
                         else:
                            raise RedirectException("html", "%s (%d sec)" % (url, timeout))
+                     icon = parser.icon
+                     if not icon:
+                        icon = "/favicon.ico"
+                     icon = urljoin("%s://%s" % (url_type, url_host), icon)
+                     if self.log: self.log("   icon           : %s" % icon)
                except KeyError:
                   pass