Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

Commit

Permalink
Minor cleanups , double flushing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kimoantiqe committed May 22, 2018
1 parent 86f5846 commit 4789c80
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 81 deletions.
2 changes: 1 addition & 1 deletion App/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ app.post('/form', function(req, res) {
var pyshell = new PythonShell('scripts/script.py',options);

pyshell.on('message', function (message) {
console.log('messege: '+message);
//console.log('messege: '+ message);
res.send(message);
});

Expand Down
3 changes: 3 additions & 0 deletions App/debug.log
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@
[0522/144133.682:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
[0522/144133.683:ERROR:exception_snapshot_win.cc(88)] thread ID 22432 not found in process
[0522/144133.683:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0522/192533.577:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
[0522/192533.577:ERROR:exception_snapshot_win.cc(88)] thread ID 3532 not found in process
[0522/192533.577:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
75 changes: 0 additions & 75 deletions App/scripts/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,74 +394,6 @@ def globalNews(info,handleCount):
websites["successful"].append("Global News")


##def kijiji(price,dateFrom,dateTo,title,description,postalCode,street,organizerPhone):
#### driver.execute_script("window.open('https://www.kijiji.ca/t-login.html?targetUrl=L3Atc2VsZWN0LWNhdGVnb3J5Lmh0bWw/Y2F0ZWdvcnlJZD0yODkmdXNlclJlZ2lzdGVyZWQ9dHJ1ZV54Tk1KeU9ySTA5U0Z3MDdzS213OC93PT0',
#### 'new window')")
##
## try:
## usernameField = driver.find_element_by_id("LoginEmailOrNickname")
## except NoSuchElementException:
## print('Username field ID changed')
##
## usernameField.send_keys(username)
##
## try:
## passwordField = driver.find_element_by_id("login-password")
## except NoSuchElementException:
## print('Password field ID changed')
##
## passwordField.send_keys(password)
## passwordField.submit()
##
## try:
## myElem = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'FormLocationPicker')))
## except TimeoutException:
## print ("Loading took too much time!")
##
## element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.LINK_TEXT, "British Columbia")))
## element.click()
## element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.LINK_TEXT, "Greater Vancouver Area")))
## element.click()
## element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.LINK_TEXT, "Vancouver")))
## element.click()
##
## form = driver.find_element_by_id("PageSelect")
## form.click()
## try:
## priceField = driver.find_element_by_id("PriceAmount")
## priceField.send_keys(price)
##
## dateField = driver.find_element_by_id("SelectDate")
## dateField.send_keys(dateFrom)
##
## dateToField = driver.find_element_by_id("SelectDateTo")
## dateToField.send_keys(dateTo)
##
## titleField = driver.find_element_by_id("postad-title")
## titleField.send_keys(title)
##
## descriptionField = driver.find_element_by_id("pstad-descrptn")
## descriptionField.send_keys(description)
##
## postalCodeField = driver.find_element_by_id("PostalCode")
## postalCodeField.send_keys(postalCode)
##
## streetField = driver.find_element_by_id("pstad-map-address")
## streetField.send_keys(street)
##
## numberField = driver.find_element_by_id("PhoneNumber")
## numberField.send_keys(organizerPhone)
## except:
## websites['unsuccessful'].append("Kijiji")
## else:
## try:
## driver.implicitly_wait(10)
## driver.find_element_by_id("SelectDate")
## websites['unsuccessful'].append("Kijiji")
## except NoSuchElementException:
## websites['successful'].append("Kijiji")


def metroVancouver(info,handleCount):
try:
title = info['event_title']
Expand Down Expand Up @@ -1014,17 +946,12 @@ def main():
input = sys.argv[1]
info = json.loads(input)

## f = open('C:/Users/Nadeem AbdelAziz/Desktop/Extracurriculars/sample.json', "r")
## s = f.read()
## info = json.loads(s)


functions = {
"Eventful": eventful,
"Youth Core": youthCore,
"Planet Friendly":planetFriendly,
"Global News": globalNews,
## "Kijiji": kijiji,
"Metro Vancouver": metroVancouver,
"City of North Van Community": cnv,
"Ubyssey": ubyssey,
Expand All @@ -1041,10 +968,8 @@ def main():
pass


sys.stdout.flush()
print(json.dumps(websites))
sys.stdout.flush()
## quit()



Expand Down
6 changes: 3 additions & 3 deletions App/views/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Mete data-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="favicon.ico">
<link rel="icon" href="css/favicon.ico">


<!-- Style Sheets-->
Expand All @@ -15,8 +15,8 @@
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel = "stylesheet" href = "https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css">
<link rel="stylesheet" type="text/css" href="materialize/css/materialize.css">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="css/materialize/css/materialize.css">
<link rel="stylesheet" type="text/css" href="css/tyle.css">
<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900' rel='stylesheet' type='text/css'>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
Expand Down
6 changes: 4 additions & 2 deletions App/views/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@
<h2 class="title-h2a">Succesful Websites</h2>
<ul id="successful-web">
</ul>
<h2 class="title-h2b">*These websites were sussecfully completed , Please double check the inputed data in each website <br>
<h2 class="title-h2b">*These websites were sussecfully completed
<br>Please double check the inputed data in each website <br>
(By visiting the opened chrome tabs) and submit each form individually.</h2>
</div>

<div class="col-lg-6">
<h2 class="title-h2a">Unsuccesful Websites</h2>
<ul id="unsuccessful-web">
</ul>
<h2 class="title-h2b">*Something went wrong , we are unsure what happened with these websites</h2>
<h2 class="title-h2b">*Something went wrong
<br> we are unsure what happened with these websites</h2>
</div>
</div>
</div>
Expand Down

0 comments on commit 4789c80

Please sign in to comment.