def get_remote_url(repo=None):
    """Obtains remote origin URL, if possible. Otherwise it returns empty str.

    Args:
        None

    Returns:
      str: The remote origin url or "".
    """
    url = ""
    if repo:
        if len(repo.remotes) > 0:
            url = repo.remotes.origin.url
        # cleanup the URL so we get in in https form and without '.git' ending
        if url.endswith(".git"):
            url = url[:-4]
        if "git@" in url:
            url = "https://" + url[4:].replace(":", "/")

    return url