A simple Python script that opens Google searches in your browser with site-specific filters for popular developer and tech websites.
- Searches Google with automatic site filters
- Opens results in Brave browser
- Filters results to specific trusted websites:
- Medium
- Stack Overflow
- Python 3.x
- Brave browser installed at
/usr/bin/brave-browser
Make the script executable:
chmod +x main.pyOptionally, you can create a symlink or add the script to your PATH to use it as a system command:
# Option 1: Create a symlink in /usr/local/bin (requires sudo)
sudo ln -s $(pwd)/main.py /usr/local/bin/googlesearch
# Option 2: Add to PATH by adding this to your ~/.bashrc or ~/.zshrc
export PATH="$PATH:/path/to/goooglescript"If you've added it to your PATH or created a symlink:
googlesearch your search query hereOr run directly:
./main.py your search query heregooglesearch python list comprehension
# or
./main.py python list comprehensionThis will open a Google search for "python list comprehension" filtered to the specified websites in your Brave browser.
The script:
- Takes command-line arguments as your search query
- Constructs a Google search URL with site filters
- Opens the search results in Brave browser
- If no search query is provided, the script will display an error message
- The script is configured to use Brave browser by default
- You can modify the
valid_websiteslist inmain.pyto add or remove site filters