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

Latest commit

 

History

History
52 lines (45 loc) · 2.04 KB

README.md

File metadata and controls

52 lines (45 loc) · 2.04 KB

SPES-PE

Automatic Event Uploader for Stanley Park Ecology Society

alt text

What you need to install

How to start

  • (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

How to add more websites

STEP 1: Add website name to the drop down menue on website

<option value="funcName">New Website Name</option>

STEP 2: Add new function to python script

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")
        functions = {
              "Eventful": eventful,
              "Youth Core": youthCore,
              "Planet Friendly":planetFriendly,
              "Value of options field in html page" : funcName
              }

STEP 3 : Celebrate the addition of the new function 💥

Things to note ,
  • Follow the exact function pattern provided
  • Make sure that the function key in the function's dictionary matches the value in the options tag