You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then the main loop just calls this new variable
# Check for keywords and blacklisted words in message urls and open browser if conditions are met
async def check_urls(urls, channel_name):
for url in urls:
if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):
# Check if url contains partalert.net. If true, direct amazon link will be built.
if "partalert.net" in url:
amazon_url = get_amazon_url(url)
# Enter path to your browser webbrowser.get( mybrowser ).open(amazon_url)
print_time(f'Link opened from #{channel_name}: {amazon_url}')
else:
# Enter path to your browser webbrowser.get( mybrowser ).open(url)
print_time(f'Link opened from #{channel_name}: {url}')
if playBellSound:
winsound.PlaySound('bell.wav', winsound.SND_FILENAME)
This way only the variable on top needs to be modified when deciding to use Chrome or Edge or Firefox etc
The text was updated successfully, but these errors were encountered:
I modified my local open.py to make it more modular & easier to pick a browser to use
Declare a new variable:
# Browser path
mybrowser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
And then the main loop just calls this new variable
# Check for keywords and blacklisted words in message urls and open browser if conditions are met
async def check_urls(urls, channel_name):
for url in urls:
if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):
# Check if url contains partalert.net. If true, direct amazon link will be built.
if "partalert.net" in url:
amazon_url = get_amazon_url(url)
# Enter path to your browser
webbrowser.get( mybrowser ).open(amazon_url)
print_time(f'Link opened from #{channel_name}: {amazon_url}')
else:
# Enter path to your browser
webbrowser.get( mybrowser ).open(url)
print_time(f'Link opened from #{channel_name}: {url}')
if playBellSound:
winsound.PlaySound('bell.wav', winsound.SND_FILENAME)
This way only the variable on top needs to be modified when deciding to use Chrome or Edge or Firefox etc
The text was updated successfully, but these errors were encountered: