def urlquerybase(url):
    """
    Appends '?' or '&' to an url, so you can easily add extra GET parameters.
    """
    if url:
        if '?' in url:
            url += '&'
        else:
            url += '?'
    return url