Skip to content

Commit 7614652

Browse files
committed
added more files
1 parent 99e376f commit 7614652

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

JobSearch.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import notify2
2+
import requests
3+
import traceback
4+
from bs4 import BeautifulSoup
5+
import time
6+
7+
sc = requests.get("https://www.enggwave.com/category/mumbai")
8+
soup = BeautifulSoup(sc.text,'lxml')
9+
arr = soup.select(".td_module_16")
10+
for entry in arr:
11+
try:
12+
stri = ""
13+
anc = entry.find("a")
14+
sc = requests.get(anc["href"])
15+
soup = BeautifulSoup(sc.text,"lxml")
16+
title = soup.select("h1.entry-title")[0]
17+
print("Title "+title.text)
18+
p_tags = soup.select(".td-post-content")[0]
19+
for p in p_tags.find_all("p"):
20+
if "click here" in str(p.text).lower():
21+
print(p.text+" "+p.find("a")['href'])
22+
stri =stri + str(p.text)+" "+str(p.find("a")['href'])+"\n"
23+
else:
24+
print(p.text)
25+
stri = stri + p.text+"\n"
26+
print()
27+
notify2.init('foo')
28+
notifier =notify2.Notification("Job Announcement" , title.text)
29+
notifier.show()
30+
31+
except IndexError as e:
32+
continue

subtitle_downloader.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
import sys
4+
#!/usr/bin/python
5+
import urllib.request
6+
from zipfile import ZipFile
7+
import zipfile
8+
import io
9+
10+
for index in range(1,len(sys.argv)):
11+
argument = sys.argv[index]
12+
arga = argument.split("~")
13+
com = ""
14+
arg = ""
15+
if len(arga) == 2:
16+
com = arga[1]
17+
arg = arga[0]
18+
sc = requests.get("https://subscene.com/subtitles/release?q=" + arg)
19+
soup = BeautifulSoup(sc.text , 'lxml')
20+
rows = soup.find_all("tr")
21+
for row in rows:
22+
if "English" in str(row.find("span").text).replace(" ",""):
23+
url = "https://subscene.com" + row.find("a")['href']
24+
sc = requests.get(url)
25+
soup = BeautifulSoup(sc.text , 'lxml')
26+
release = soup.select(".release")[0].find_all("div")
27+
fallback = True
28+
for divs in release:
29+
if com in divs.text:
30+
fallback = False
31+
break
32+
if fallback:
33+
continue
34+
dwnld = soup.select("#downloadButton")[0]
35+
url = "https://subscene.com" + dwnld['href']
36+
name = str(soup.select(".release")[0].find_all("div")[0].text).replace(" ","").rstrip() + ".srt"
37+
r = requests.get(url)
38+
z = zipfile.ZipFile(io.BytesIO(r.content))
39+
z.extractall()
40+
break

0 commit comments

Comments
 (0)