import webbrowser
import wikipedia
import requests

def yt_search(search: str):
    webbrowser.open_new_tab(f"https://www.youtube.com/results?search_query={search}")

def google_search(search: str):
    webbrowser.open_new_tab(f"https://www.google.com/search?q={search}")

def bing_search(search: str):
    webbrowser.open_new_tab(f"https://www.bing.com/search?q={search}")

def duck_search(search: str):
    webbrowser.open_new_tab(f"https://duckduckgo.com/?q={search}")

def yahoo_search(search: str):
    webbrowser.open_new_tab(f"https://search.yahoo.com/search?p={search}")

def ask_search(search: str):
    webbrowser.open_new_tab(f"https://www.ask.com/web?q={search}")

def yandex_search(search: str):
    webbrowser.open_new_tab(f"https://yandex.com/search/?text={search}")

def ecosia_search(search: str):
    webbrowser.open_new_tab(f"https://www.ecosia.org/search?q={search}")

def fb_search(search: str):
    webbrowser.open_new_tab(f"https://www.facebook.com/search/top/?q={search}")

def wiki_terminal_search(search: str, lang='en', sentence=1):
    try:
        wikipedia.set_lang(lang)
        print(wikipedia.summary(search, sentences=sentence))
    except Exception as error:
        print(error)
        return error
    
def mail_search(search: str):
    webbrowser.open_new_tab(f"https://mail.google.com/mail/u/0/#search/{search}")

def wiki_web_search(search: str):
    webbrowser.open_new_tab(f"https://en.wikipedia.org/wiki/{search}")

def test_site(search: str):
    """please enter site name with http information"""
    try:
        r = requests.get(search)

    except Exception as error:
        print(error)
        return "site not working"
    
    if r.status_code == 200:
        print("site working")
        return "site working"

[((6, 4, 6, 85), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(6, 28, 6, 84): 'f"""https://www.youtube.com/results?search_query={search}"""'}, {}), "(\n    f'https://www.youtube.com/results?search_query={search}')", False, 'import webbrowser\n'), ((9, 4, 9, 72), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(9, 28, 9, 71): 'f"""https://www.google.com/search?q={search}"""'}, {}), "(f'https://www.google.com/search?q={search}')", False, 'import webbrowser\n'), ((12, 4, 12, 70), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(12, 28, 12, 69): 'f"""https://www.bing.com/search?q={search}"""'}, {}), "(f'https://www.bing.com/search?q={search}')", False, 'import webbrowser\n'), ((15, 4, 15, 66), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(15, 28, 15, 65): 'f"""https://duckduckgo.com/?q={search}"""'}, {}), "(f'https://duckduckgo.com/?q={search}')", False, 'import webbrowser\n'), ((18, 4, 18, 74), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(18, 28, 18, 73): 'f"""https://search.yahoo.com/search?p={search}"""'}, {}), "(f'https://search.yahoo.com/search?p={search}')", False, 'import webbrowser\n'), ((21, 4, 21, 66), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(21, 28, 21, 65): 'f"""https://www.ask.com/web?q={search}"""'}, {}), "(f'https://www.ask.com/web?q={search}')", False, 'import webbrowser\n'), ((24, 4, 24, 72), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(24, 28, 24, 71): 'f"""https://yandex.com/search/?text={search}"""'}, {}), "(f'https://yandex.com/search/?text={search}')", False, 'import webbrowser\n'), ((27, 4, 27, 72), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(27, 28, 27, 71): 'f"""https://www.ecosia.org/search?q={search}"""'}, {}), "(f'https://www.ecosia.org/search?q={search}')", False, 'import webbrowser\n'), ((30, 4, 30, 79), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(30, 28, 30, 78): 'f"""https://www.facebook.com/search/top/?q={search}"""'}, {}), "(f'https://www.facebook.com/search/top/?q={search}')", False, 'import webbrowser\n'), ((41, 4, 41, 81), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(41, 28, 41, 80): 'f"""https://mail.google.com/mail/u/0/#search/{search}"""'}, {}), "(f'https://mail.google.com/mail/u/0/#search/{search}')", False, 'import webbrowser\n'), ((44, 4, 44, 70), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', ({(44, 28, 44, 69): 'f"""https://en.wikipedia.org/wiki/{search}"""'}, {}), "(f'https://en.wikipedia.org/wiki/{search}')", False, 'import webbrowser\n'), ((34, 8, 34, 32), 'wikipedia.set_lang', 'wikipedia.set_lang', ({(34, 27, 34, 31): 'lang'}, {}), '(lang)', False, 'import wikipedia\n'), ((49, 12, 49, 32), 'requests.get', 'requests.get', ({(49, 25, 49, 31): 'search'}, {}), '(search)', False, 'import requests\n'), ((35, 14, 35, 59), 'wikipedia.summary', 'wikipedia.summary', (), '', False, 'import wikipedia\n')]