def perform_discovery(uri)
      begin
        parsed_uri = URI::parse(uri)
        if parsed_uri.scheme.nil?
          return discover_site(uri)
        end
        return discover_user(parsed_uri.host, uri)
      rescue
        # If we fail, just return nothing and fallback on default discovery mechanisms
        return nil
      end
    end
def perform_discovery(uri)
      begin
        parsed_uri = URI::parse(uri)
        if parsed_uri.scheme.nil?
          return discover_site(uri)
        end
        return discover_user(parsed_uri.host, uri)
      rescue
        # If we fail, just return nothing and fallback on default discovery mechanisms
        return nil
      end
    end
Main entry point for discovery.  Attempts to detect whether or not the URI is a raw domain name ('mycompany.com')
 vs. a user's claimed ID ('http://mycompany.com/openid?id=12345') and performs the site or user discovery appropriately