Automatic Event Uploader for Stanley Park Ecology Society
- (Windows) Double click on start.bat
- (Mac/Linux) navigate inside the app folder , type node app.js in terminal and go to localhost:8000 on your browser
- Go to views/landing.html
- Add the new website's name in an options tag
<option value="funcName">New Website Name</option>
- Go to scripts/script.py
- Define a new function in the following format
def funcName(info,handleCount):
try:
driver.execute_script('''window.open("http://website.com","_blank");''')
driver.switch_to.window(driver.window_handles[handleCount])
## Scrape website here
except:
websites["unsuccessful"].append("Website Name")
else:
websites["successful"].append("Website Name")
- Add the func to the functions dictionary
functions = {
"Eventful": eventful,
"Youth Core": youthCore,
"Planet Friendly":planetFriendly,
"Value of options field in html page" : funcName
}
- Follow the exact function pattern provided
- Make sure that the function key in the function's dictionary matches the value in the options tag