source/io/web_scraper.py
def generate_api_header():
    """Creates the HTTP header which is sent when making Wikipedia API calls"""
    if_from_web_text = "from web"
    if not __metadata__.__IF_WEB__:
        if_from_web_text = "from desktop" #If it's locally launched, mention that
    
    header = {
        'User-Agent': 'wiki_verify/'+__metadata__.__VERSION__+"(https://verify.toolforge.org/) "+if_from_web_text,
        'UPGRADE-INSECURE-REQUESTS': "1",
        'Accept-Encoding': "gzip" #gzip preferred by API
        }
    return header
Creates the HTTP header which is sent when making Wikipedia API calls
Creates the HTTP header which is sent when making Wikipedia API calls
Creates the HTTP header which is sent when making Wikipedia API calls
def generate_api_header():
    if_from_web_text = "from web"
    if not __metadata__.__IF_WEB__:
        if_from_web_text = "from desktop" 
    header = {
        'User-Agent': 'wiki_verify/'+__metadata__.__VERSION__+"(https://verify.toolforge.org/) "+if_from_web_text,
        'UPGRADE-INSECURE-REQUESTS': "1",
        'Accept-Encoding': "gzip" 
        }
    return header
def generate_api_header ( ) : if_from_web_text = "from web" if not __metadata__ . __IF_WEB__ : if_from_web_text = "from desktop" header = { 'User-Agent' : 'wiki_verify/' + __metadata__ . __VERSION__ + "(https://verify.toolforge.org/) " + if_from_web_text , 'UPGRADE-INSECURE-REQUESTS' : "1" , 'Accept-Encoding' : "gzip" } return header
Creates the HTTP header which is sent when making Wikipedia API calls
Creates the HTTP header which is sent when making Wikipedia API calls
"""Creates the HTTP header which is sent when making Wikipedia API calls""" #If it's locally launched, mention that #gzip preferred by API