-
Notifications
You must be signed in to change notification settings - Fork 5
Description
pySearch currently creates and opens links that may not exist. For example, current behavior defaults the domain to .ca however there is a chance that the domain is unsupported by the search engine (consider http://stackoverflow.ca/search?q=test.
In these cases the script should give the user a message stating that the built link is invalid. After this the code should try different popular domain extensions to see if any work. If a valid domain extension exists then provide a message which informs the user of the found domain and opens the link in the browser.
I believe the most lightweight solution would be a calling ping to the subsystem shell using os.system() subprocess (instructions on replacing os.system()/example here). In theory a successful ping should return error code 0 and all other returns should signify an error.