👨‍🏫 Tutorial Hotel101 Notifier

Status
Not open for further replies.
Python:
import requests

import smtplib

from email.mime.text import MIMEText

from time import sleep



# Email setup

def send_email_notification():

    sender = 'your-email@gmail.com'

    receiver = 'receiver-email@gmail.com'

    subject = 'Registration Available'

    body = 'The registration for Hotel 101 is now available!'



    msg = MIMEText(body)

    msg['Subject'] = subject

    msg['From'] = sender

    msg['To'] = receiver



    with smtplib.SMTP('smtp.gmail.com', 587) as server:

        server.starttls()

        server.login('your-email@gmail.com', 'your-email-password')

        server.sendmail(sender, receiver, msg.as_string())



# API URL and request

api_url = "https://hotel101app.com/api/auth/login"



def check_registration():

    response = requests.get(api_url)

    if response.status_code == 200:  # You may need to adjust this based on API response

        print("API reachable, checking registration availability...")

        # Assuming an available registration returns a specific status or message

        if "registration open" in response.text.lower():

            send_email_notification()

            print("Notification sent: Registration available!")

        else:

            print("Registration not available yet.")

    else:

        print(f"Error: API returned status code {response.status_code}")



# Loop to check every 60 seconds

while True:

    check_registration()

    sleep(60)  # Check every 60 seconds


ito code kaso di ko alam paano to haha
 
Python:
import requests

import smtplib

from email.mime.text import MIMEText

from time import sleep



# Email setup

def send_email_notification():

    sender = 'your-email@gmail.com'

    receiver = 'receiver-email@gmail.com'

    subject = 'Registration Available'

    body = 'The registration for Hotel 101 is now available!'



    msg = MIMEText(body)

    msg['Subject'] = subject

    msg['From'] = sender

    msg['To'] = receiver



    with smtplib.SMTP('smtp.gmail.com', 587) as server:

        server.starttls()

        server.login('your-email@gmail.com', 'your-email-password')

        server.sendmail(sender, receiver, msg.as_string())



# API URL and request

api_url = "https://hotel101app.com/api/auth/login"



def check_registration():

    response = requests.get(api_url)

    if response.status_code == 200:  # You may need to adjust this based on API response

        print("API reachable, checking registration availability...")

        # Assuming an available registration returns a specific status or message

        if "registration open" in response.text.lower():

            send_email_notification()

            print("Notification sent: Registration available!")

        else:

            print("Registration not available yet.")

    else:

        print(f"Error: API returned status code {response.status_code}")



# Loop to check every 60 seconds

while True:

    check_registration()

    sleep(60)  # Check every 60 seconds


ito code kaso di ko alam paano to haha
nag up na ba kanina?
 
Python:
import requests

import smtplib

from email.mime.text import MIMEText

from time import sleep



# Email setup

def send_email_notification():

    sender = 'your-email@gmail.com'

    receiver = 'receiver-email@gmail.com'

    subject = 'Registration Available'

    body = 'The registration for Hotel 101 is now available!'



    msg = MIMEText(body)

    msg['Subject'] = subject

    msg['From'] = sender

    msg['To'] = receiver



    with smtplib.SMTP('smtp.gmail.com', 587) as server:

        server.starttls()

        server.login('your-email@gmail.com', 'your-email-password')

        server.sendmail(sender, receiver, msg.as_string())



# API URL and request

api_url = "https://hotel101app.com/api/auth/login"



def check_registration():

    response = requests.get(api_url)

    if response.status_code == 200:  # You may need to adjust this based on API response

        print("API reachable, checking registration availability...")

        # Assuming an available registration returns a specific status or message

        if "registration open" in response.text.lower():

            send_email_notification()

            print("Notification sent: Registration available!")

        else:

            print("Registration not available yet.")

    else:

        print(f"Error: API returned status code {response.status_code}")



# Loop to check every 60 seconds

while True:

    check_registration()

    sleep(60)  # Check every 60 seconds


ito code kaso di ko alam paano to haha
sala ata yan lods, from AI yan no sir?

ewan ko kung ok yung gawa ko pero sakin di parin nag uup


1727951629921.webp
 
telegram bot token sir and chat ID nag send naman sya msg. sa tele nung tnry ko change sa 503 itong
def check_system():
try:
response = requests.get(URL)
# Check if the response status code is 200 (OK)
if response.status_code == 200:
print("Hotel101 system is up!")
 
Status
Not open for further replies.

About this Thread

  • 112
    Replies
  • 5K
    Views
  • 44
    Participants
Last reply from:
tologobo

Online now

Members online
973
Guests online
1,145
Total visitors
2,118

Forum statistics

Threads
2,274,263
Posts
28,954,700
Members
1,234,171
Latest member
NgoNge
Back
Top