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"

[((84, 170), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.youtube.com/results?search_query={search}"""'], {}), "(\n    f'https://www.youtube.com/results?search_query={search}')\n", (107, 170), False, 'import webbrowser\n'), ((203, 271), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.google.com/search?q={search}"""'], {}), "(f'https://www.google.com/search?q={search}')\n", (226, 271), False, 'import webbrowser\n'), ((307, 373), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.bing.com/search?q={search}"""'], {}), "(f'https://www.bing.com/search?q={search}')\n", (330, 373), False, 'import webbrowser\n'), ((409, 471), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://duckduckgo.com/?q={search}"""'], {}), "(f'https://duckduckgo.com/?q={search}')\n", (432, 471), False, 'import webbrowser\n'), ((508, 578), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://search.yahoo.com/search?p={search}"""'], {}), "(f'https://search.yahoo.com/search?p={search}')\n", (531, 578), False, 'import webbrowser\n'), ((613, 675), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.ask.com/web?q={search}"""'], {}), "(f'https://www.ask.com/web?q={search}')\n", (636, 675), False, 'import webbrowser\n'), ((713, 781), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://yandex.com/search/?text={search}"""'], {}), "(f'https://yandex.com/search/?text={search}')\n", (736, 781), False, 'import webbrowser\n'), ((819, 887), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.ecosia.org/search?q={search}"""'], {}), "(f'https://www.ecosia.org/search?q={search}')\n", (842, 887), False, 'import webbrowser\n'), ((921, 996), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://www.facebook.com/search/top/?q={search}"""'], {}), "(f'https://www.facebook.com/search/top/?q={search}')\n", (944, 996), False, 'import webbrowser\n'), ((1275, 1352), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://mail.google.com/mail/u/0/#search/{search}"""'], {}), "(f'https://mail.google.com/mail/u/0/#search/{search}')\n", (1298, 1352), False, 'import webbrowser\n'), ((1392, 1458), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['f"""https://en.wikipedia.org/wiki/{search}"""'], {}), "(f'https://en.wikipedia.org/wiki/{search}')\n", (1415, 1458), False, 'import webbrowser\n'), ((1077, 1101), 'wikipedia.set_lang', 'wikipedia.set_lang', (['lang'], {}), '(lang)\n', (1095, 1101), False, 'import wikipedia\n'), ((1564, 1584), 'requests.get', 'requests.get', (['search'], {}), '(search)\n', (1576, 1584), False, 'import requests\n'), ((1116, 1161), 'wikipedia.summary', 'wikipedia.summary', (['search'], {'sentences': 'sentence'}), '(search, sentences=sentence)\n', (1133, 1161), False, 'import wikipedia\n')]