Finding URLs and in particular URLs to KTH Play

Sometimes it is useful to know what URLs you refer to in your pages. To do this I made a simple program https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_URLs_on_pages_in_course.py  or  Download compute_list_of_URLs_on_pages_in_course.py

From this it was easy to make a program to just collects those URLs that point to KTH Play (i.e., play.kth.se), see https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_KTH_play_URLs_on_pages_in_course.py or  Download compute_list_of_KTH_play_URLs_on_pages_in_course.py

If you have a different form of URL for your videos, change the function:


def unique_KTH_Play_URLs(set_of_urls):
       set_of_unique_URLs=set()

       for t in set_of_urls:
              if t.find("//play.kth.se") >= 0:
                     set_of_unique_URLs.add(t)
       return set_of_unique_URLs

If the syllabus has a URL to KTH Play you get this included as if it were another page with the following program:  Download compute_list_of_KTH_play_URLs_on_pages_in_course2.py

The third version of the program will even collect KTH Play URLs from assignments  Download compute_list_of_KTH_play_URLs_on_pages_in_course3.py

It is even possible to make a program that can collect all of the URLs mentioned in a page, but that are not links: https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_URLs_in_text_on_pages_in_course.py or  Download compute_list_of_URLs_in_text_on_pages_in_course.py