Website Availability & Uptime Tracker

 import requests

import schedule

import time

import smtplib

from email.mime.text import MIMEText


# List of websites to track

websites = {

    "Google": "https://www.google.com",

    "My Portfolio": "https://yourportfolio.com"

}


# Email Config

EMAIL_ADDRESS = "your_email@gmail.com"

EMAIL_PASSWORD = "your_app_password"

TO_EMAIL = "recipient_email@example.com"


def send_email_alert(site):

    msg = MIMEText(f"Alert: {site} is DOWN!")

    msg["Subject"] = f"๐Ÿšจ {site} is Down!"

    msg["From"] = EMAIL_ADDRESS

    msg["To"] = TO_EMAIL


    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp:

        smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)

        smtp.send_message(msg)

        print(f"Email sent: {site} is down.")


def check_sites():

    for name, url in websites.items():

        try:

            response = requests.get(url, timeout=5)

            if response.status_code != 200:

                print(f"[{name}] Status: {response.status_code}")

                send_email_alert(name)

            else:

                print(f"[{name}] is up ✅")

        except requests.exceptions.RequestException:

            print(f"[{name}] is unreachable ❌")

            send_email_alert(name)


# Check every 5 minutes

schedule.every(5).minutes.do(check_sites)


print("๐Ÿ” Website Uptime Tracker Started...")

while True:

    schedule.run_pending()

    time.sleep(1)



Twilio SMS Integration


from twilio.rest import Client

account_sid = "your_sid"
auth_token = "your_token"
twilio_number = "+1234567890"
receiver_number = "+91999xxxxxxx"

def send_sms_alert(site):
    client = Client(account_sid, auth_token)
    client.messages.create(
        body=f"๐Ÿšจ {site} is DOWN!",
        from_=twilio_number,
        to=receiver_number
    )

Document Similarity Checker

 import streamlit as st

from sklearn.feature_extraction.text import TfidfVectorizer

from sklearn.metrics.pairwise import cosine_similarity

import spacy


nlp = spacy.load("en_core_web_sm")


st.title("๐Ÿ“„ Document Similarity Checker")


def preprocess(text):

    doc = nlp(text)

    return " ".join([token.lemma_ for token in doc if not token.is_stop and token.is_alpha])


file1 = st.file_uploader("Upload First Document", type=["txt"])

file2 = st.file_uploader("Upload Second Document", type=["txt"])


if file1 and file2:

    text1 = file1.read().decode("utf-8")

    text2 = file2.read().decode("utf-8")


    clean_text1 = preprocess(text1)

    clean_text2 = preprocess(text2)


    tfidf = TfidfVectorizer()

    tfidf_matrix = tfidf.fit_transform([clean_text1, clean_text2])

    sim_score = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix[1:2])[0][0]


    st.subheader("๐Ÿงฎ Similarity Score")

    st.write(f"**{sim_score:.2f}** (1 = identical, 0 = completely different)")


    if sim_score > 0.75:

        st.success("The documents are quite similar! ๐ŸŸข")

    elif sim_score > 0.4:

        st.info("The documents are moderately similar. ๐ŸŸก")

    else:

        st.warning("The documents are quite different. ๐Ÿ”ด")


Smart Calendar CLI App

 import click

import requests

from datetime import datetime, timedelta


# Placeholder for real GCal and weather integration

EVENTS = [

    {"title": "Standup Meeting", "time": "10:00", "date": "2025-04-16", "location": "Remote"},

    {"title": "Doctor Appointment", "time": "15:00", "date": "2025-04-16", "location": "City Clinic"},

]


@click.group()

def cli():

    pass


@cli.command()

def today():

    click.echo("๐Ÿ“… Today's Events:")

    today = datetime.today().strftime('%Y-%m-%d')

    for e in EVENTS:

        if e["date"] == today:

            click.echo(f"- {e['time']}: {e['title']} ๐Ÿ“ {e['location']}")


@cli.command()

@click.option('--title', prompt='Event title')

@click.option('--date', prompt='Event date (YYYY-MM-DD)')

@click.option('--time', prompt='Event time (HH:MM)')

@click.option('--location', prompt='Event location')

def add(title, date, time, location):

    EVENTS.append({"title": title, "date": date, "time": time, "location": location})

    click.echo("✅ Event created successfully!")


@cli.command()

def forecast():

    if not EVENTS:

        click.echo("No events to check weather for.")

        return

    event = EVENTS[-1]

    click.echo(f"๐ŸŒฆ Forecast for: {event['title']}")

    weather = get_weather(event['location'])

    click.echo(f"๐Ÿ“ Location: {event['location']} | Date: {event['date']}")

    click.echo(f"☁️ Weather Forecast: {weather}")


def get_weather(city):

    API_KEY = "your_openweathermap_api_key"

    url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric"

    r = requests.get(url)

    if r.status_code == 200:

        data = r.json()

        return f"{data['weather'][0]['main']}, {data['main']['temp']}°C"

    return "Weather data unavailable"


if __name__ == '__main__':

    cli()


Voice-Controlled Notes App

import speech_recognition as sr

import pyttsx3

import os


notes = {}


engine = pyttsx3.init()


def speak(text):

    engine.say(text)

    engine.runAndWait()


def listen_command():

    r = sr.Recognizer()

    with sr.Microphone() as source:

        speak("Listening...")

        audio = r.listen(source)

    try:

        command = r.recognize_google(audio)

        return command.lower()

    except:

        speak("Sorry, I didn't catch that.")

        return ""


def create_note():

    speak("What should I name the note?")

    title = listen_command()

    speak("What is the content?")

    content = listen_command()

    notes[title] = content

    speak(f"Note '{title}' created.")


def read_notes():

    if notes:

        for title, content in notes.items():

            speak(f"{title}: {content}")

    else:

        speak("No notes found.")


def delete_note():

    speak("Which note should I delete?")

    title = listen_command()

    if title in notes:

        del notes[title]

        speak(f"Note '{title}' deleted.")

    else:

        speak("Note not found.")


def main():

    speak("Voice Notes App Started.")

    while True:

        speak("Say a command: create, read, delete, or exit.")

        command = listen_command()


        if "create" in command:

            create_note()

        elif "read" in command:

            read_notes()

        elif "delete" in command:

            delete_note()

        elif "exit" in command:

            speak("Goodbye!")

            break

        else:

            speak("Unknown command.")


if __name__ == "__main__":

    main()


Chemistry Molecule Visualizer

 import streamlit as st

from rdkit import Chem

from rdkit.Chem import Draw, Descriptors

import py3Dmol


def mol_to_3d_view(smiles):

    mol = Chem.MolFromSmiles(smiles)

    mb = Chem.AddHs(mol)

    Chem.EmbedMolecule(mb)

    mol_block = Chem.MolToMolBlock(mb)


    viewer = py3Dmol.view(width=400, height=400)

    viewer.addModel(mol_block, 'mol')

    viewer.setStyle({'stick': {}})

    viewer.zoomTo()

    return viewer


st.title("๐Ÿงช Chemistry Molecule Visualizer")


smiles = st.text_input("Enter SMILES string", "CC(=O)O")  # Acetic Acid


if smiles:

    mol = Chem.MolFromSmiles(smiles)

    

    if mol:

        st.subheader("๐Ÿ“Œ Molecular Structure (2D)")

        st.image(Draw.MolToImage(mol, size=(300, 300)))


        st.subheader("๐Ÿ”ฌ Properties")

        st.markdown(f"**Formula**: {Chem.rdMolDescriptors.CalcMolFormula(mol)}")

        st.markdown(f"**Molecular Weight**: {Descriptors.MolWt(mol):.2f} g/mol")


        st.subheader("๐Ÿงฌ 3D Structure")

        viewer = mol_to_3d_view(smiles)

        viewer_html = viewer._make_html()

        st.components.v1.html(viewer_html, height=450)

    else:

        st.error("Invalid SMILES string. Try again.")