2

Okay so I am making a script that gives you a notification in windows 10 IF you access a certain site.

So an example: You go to the site like: twitter.com, then the Python script will detect that and it will run the other script (notification script).

This is the notification script:

import time

from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Distracting",
                   "You are now going on a disstracting site.",
                   icon_path=None,
                   duration=5,
                   threaded=True)
FinnCoding
  • 21
  • 1
  • You might need to create a browser plugin to do this. – Carcigenicate Jun 16 '18 at 14:35
  • You would need to somehow get _any_ installed browser on the PC to notify your script that the user changed an url - which is neight to impossible. You could try to find out if anybody provides a module to ask for open OS-window-titles (f.e. titles of all activce windows on your pc which could be done by leveraging the winapi in c++/c# ) and do some guesswork, but I wouldnt invest much time/effort into that. – Patrick Artner Jun 16 '18 at 14:45
  • You could use a network sniffer and analyse outgoing HTTP request to your domain blacklist. I have no experience with these but in this question some libraries are proposed https://stackoverflow.com/questions/15906308/how-to-sniff-http-packets-in-python – Wombatz Jun 16 '18 at 15:36

0 Answers0