From 978c200e895546ba12376a18b01e10f379813fe7 Mon Sep 17 00:00:00 2001 From: r <31166087+dthinkcs@users.noreply.github.com> Date: Fri, 19 Oct 2018 12:36:17 +0530 Subject: [PATCH 1/4] Create cc_downlaoder.py --- cc_downlaoder.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 cc_downlaoder.py diff --git a/cc_downlaoder.py b/cc_downlaoder.py new file mode 100644 index 0000000..851b21d --- /dev/null +++ b/cc_downlaoder.py @@ -0,0 +1,6 @@ +# http://web.stanford.edu/class/archive/cs/cs103/cs103.1184/lectures/00/Slides00.pdf + +import wget + +for i in range(13): + wget.download("https://cdn.cs50.net/mobile/2018/spring/lectures/{}/lang/en/lecture{}.srt".format(i, i)) From af92e0eec890b9c3a93b1eba91ec118e735de89d Mon Sep 17 00:00:00 2001 From: rishabh Date: Sat, 12 Oct 2019 23:59:30 +0530 Subject: [PATCH 2/4] Create d.md --- d.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 d.md diff --git a/d.md b/d.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/d.md @@ -0,0 +1 @@ + From 0e5e0440186bbd71d707ccd5f5ef560964516e2b Mon Sep 17 00:00:00 2001 From: rj Date: Thu, 5 Dec 2019 03:49:18 +0530 Subject: [PATCH 3/4] send shivers down my spine --- download_links.py | 41 ++++++++++++++++++++++++++++++++++++++ download_links_sp.py | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 download_links.py create mode 100644 download_links_sp.py diff --git a/download_links.py b/download_links.py new file mode 100644 index 0000000..1df97e9 --- /dev/null +++ b/download_links.py @@ -0,0 +1,41 @@ +from bs4 import BeautifulSoup, SoupStrainer +import requests +import sys + +if len(sys.argv) < 1: + print("Invalid Entry") + exit() + +url = sys.argv[1] +tempurl = url.replace("//", "") +baseurl = tempurl[:tempurl.find("/")] +print(baseurl) + + +page = requests.get(url) +data = page.text +soup = BeautifulSoup(data) + +for link in soup.find_all('a'): + if link.get('href'): + if link.get('href')[0] == "/": + print(baseurl + link.get('href')) + else: + print(link.get('href')) + + +# Full url: +# http://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string + +# Base: + +# stackoverflow.com + +# Regex: +# (http(s)?:\/\/)|(\/.*){1} + +# Example in JavaScript: + +# function toBaseURL(fullURL){ +# return fullURL.replace(/(http(s)?:\/\/)|(\/.*){1}/g, ''); +# } \ No newline at end of file diff --git a/download_links_sp.py b/download_links_sp.py new file mode 100644 index 0000000..ac7713d --- /dev/null +++ b/download_links_sp.py @@ -0,0 +1,47 @@ +from bs4 import BeautifulSoup, SoupStrainer +import requests +import sys + +if len(sys.argv) < 1: + print("Invalid Entry") + exit() + +url = sys.argv[1] +tempurl = url.replace("//", "") +baseurl = url[:tempurl.find("/") + len("//")] +print(baseurl) + + +page = requests.get(url) +data = page.text +soup = BeautifulSoup(data) + +lt = [] +for link in soup.find_all('a'): + if link.get('href'): + if link.get('href')[0] == "/" and '/file' in link.get('href'): + lt.append(baseurl + link.get('href')) + # else: + # print(link.get('href')) + +def customFn(s): + return s[s.rindex("/") + 1 : ] +lt.sort(key=customFn) +for ele in lt: + print(ele) + +# Full url: +# http://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string + +# Base: + +# stackoverflow.com + +# Regex: +# (http(s)?:\/\/)|(\/.*){1} + +# Example in JavaScript: + +# function toBaseURL(fullURL){ +# return fullURL.replace(/(http(s)?:\/\/)|(\/.*){1}/g, ''); +# } \ No newline at end of file From 8cc974757ea875c6d7051bf3d8ff15a8ace92a2d Mon Sep 17 00:00:00 2001 From: rj Date: Fri, 10 Jan 2020 22:41:23 +0530 Subject: [PATCH 4/4] yolo --- __pycache__/import0.cpython-37.pyc | Bin 0 -> 439 bytes import0.py | 17 +++++++++++++++++ import1.py | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 __pycache__/import0.cpython-37.pyc create mode 100644 import0.py create mode 100644 import1.py diff --git a/__pycache__/import0.cpython-37.pyc b/__pycache__/import0.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8fe3cd35c036dcb572b7b6ee04a7392378bacff GIT binary patch literal 439 zcmY*Vu};H447D#8DMGDaK%xUfM>0SdkwAa|F=nY)7?4mdB2k+*x;qd--O9+1@JpGH znEDHdf#+19Vx6Duv(NUsi++EDAjfZmyKmS}34TSvIfuG!fFZ-LbW28=0G5p&Q5rzq2`oRqlMRsm+DmR+Ze8MwJiC9&le+Q6Y`X6yE~`R`du&%?a`{j z=pE!%{s=^cSo*T*i_#5os%9wLFVUMG1c*M)mO?mIZCKlK>e~Pivy}xqdMnTpN}+s+ n>j6kbyu}*YQ(Y#FRmZ0b)}9I_EAQLrq?(z>Nq+kG1yS$=m>y2% literal 0 HcmV?d00001 diff --git a/import0.py b/import0.py new file mode 100644 index 0000000..cc132c7 --- /dev/null +++ b/import0.py @@ -0,0 +1,17 @@ +#from math import ceil + + + +def myFn(x): + return ceil(x) + +def ceil(x): + # only works for + + print("this is my ceil") + if x - int(x) == 0: + return x + elif x - int(x) >= 0.5: + return int(x) + 1 + else: + return int(x) + diff --git a/import1.py b/import1.py new file mode 100644 index 0000000..b29dc9f --- /dev/null +++ b/import1.py @@ -0,0 +1,6 @@ +#import math didn't work #Due to NamespaceCollxn NameError: name 'ceil' is not defined +from import0 import myFn +from math import ceil + +print(myFn(5.3)) +print(ceil(5.3)) \ No newline at end of file