Ejemplo n.º 1
0
    # parameters to the scanner
    facilityID = jRocksCamp.getFacilityID()
    startDate = "01/05/2020"
    endDate = "01/07/2020"

    scanner = CampScanner(facilityID, startDate, endDate)

    # keep scanning until an available campsite is found.
    while (True):
        scanner.scanCampground()
        if scanner.getAvailableCampSites():
            break
        time.sleep(900)  # wait 900 secs/15 mins before scanning again

    print("Campsites Available. Sending notification...")
    # parameters to Notifier
    password = "******"  # put sending email password here
    sEmailAddr = "*****@*****.**"  # sending email address here
    rEmailAddr = "*****@*****.**"  # receiving email address to send to here
    subject = "Available Sites!"
    emailMsgBdy = ("Campsites are available at " + facilityName +
                   ". Navigate to "
                   "https://www.recreation.gov/camping/campgrounds/" +
                   facilityID + "/availability"
                   " to view the availability table.")

    notifier = Notifier(password, sEmailAddr, rEmailAddr, subject, emailMsgBdy)
    notifier.buildMessage()
    notifier.send()