• 단축 주소

    word.py

    import requests
    from bs4 import BeautifulSoup
    
    # ✅ 워드프레스 게시물 주소
    url = "https://qer.kr/?p=1031"
    res = requests.get(url)
    soup = BeautifulSoup(res.text, "html.parser")
    
    # ✅ 게시물 제목 추출
    title_tag = soup.select_one("h1.entry-title, h1.post-title")
    page_title = title_tag.get_text(strip=True) if title_tag else "용산초 바로가기 & 메모"
    
    # ✅ 본문 추출
    post_div = soup.select_one("div.post-content, div.entry-content")
    lines = []
    
    if post_div:
        for br in post_div.find_all("br"):
            br.replace_with("\n")
        raw_text = post_div.get_text()
        split_lines = raw_text.split("\n")
        for line in split_lines:
            line = line.strip()
            if line:
                lines.append(line)
    
    # ✅ 항목 분리 및 순서 저장
    items = []
    for line in lines:
        if line.startswith("@링크:") and "|" in line:
            content = line.split("@링크:", 1)[1]
            title, link = [x.strip() for x in content.split("|", 1)]
            items.append(("link", title, link))
        elif line.startswith("@메모:") and "|" in line:
            content = line.split("@메모:", 1)[1]
            title, note = [x.strip() for x in content.split("|", 1)]
            items.append(("memo", title, note))
        elif line.strip() == "@급식":
            items.append(("lunch",))
    
    # ✅ HTML 생성
    html = f"""<!DOCTYPE html>
    <html lang="ko">
    <head>
      <meta charset="UTF-8">
      <title>{page_title}</title>
      <style>
        body {{
          font-family: 'Noto Sans KR', sans-serif;
          margin: 0;
          padding: 0;
          background-color: #f8f8f8;
          color: #333;
        }}
        .container {{
          max-width: 480px;
          margin: 0 auto;
          padding: 20px;
        }}
        h1 {{
          font-size: 22px;
          text-align: center;
          margin-bottom: 30px;
          color: #333;
        }}
        .item {{
          margin-bottom: 14px;
        }}
        .link-button {{
          display: block;
          padding: 14px;
          text-align: center;
          background-color: #222;
          color: #fff;
          text-decoration: none;
          border-radius: 8px;
          font-size: 16px;
          transition: background-color 0.2s;
        }}
        .link-button:hover {{
          background-color: #444;
        }}
        .memo-box {{
          background: #fff;
          border-left: 4px solid #007acc;
          padding: 12px 16px;
          border-radius: 6px;
          box-shadow: 0 1px 4px rgba(0,0,0,0.05);
          font-size: 14px;
          line-height: 1.5;
          word-break: keep-all;
          white-space: normal;
        }}
        .memo-title {{
          font-weight: bold;
          margin-bottom: 4px;
        }}
        iframe {{
          width: 100%;
          height: 250px;
          border: none;
          border-radius: 8px;
          box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        }}
      </style>
    </head>
    <body>
      <div class="container">
        <h1>📌 {page_title}</h1>
    """
    
    for item in items:
        if item[0] == "link":
            _, title, link = item
            html += f'<div class="item"><a class="link-button" href="{link}" target="_blank">{title}</a></div>\n'
        elif item[0] == "memo":
            _, title, note = item
            html += f'<div class="item"><div class="memo-box"><div class="memo-title">{title}</div>{note}</div></div>\n'
        elif item[0] == "lunch":
            html += '<div class="item"><iframe src="https://qer.kr/lunch.html"></iframe></div>\n'
    
    html += """
      </div>
    </body>
    </html>
    """
    
    # ✅ 저장 경로
    with open("/var/www/html/yong/index.html", "w", encoding="utf-8") as f:
        f.write(html)
    
    print("✅ index.html 생성 완료 → /var/www/html/yong/index.html")
    

    @급식 으로 급식 추가

    크론탭

    35 8 * * 1-5 /usr/bin/python3 /var/www/html/yong/word.py

    추가

  • 개발

    우분투 자동 실행

    /etc/systemd/system/update.service

    [Unit]
    Description=Flask Update Server for Yong
    After=network.target
    
    [Service]
    User=ubuntu
    WorkingDirectory=/var/www/html
    ExecStart=/usr/bin/python3 /var/www/html/yong/update.py
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
    
    더 보기: 우분투 자동 실행

    ✅ 2. 서비스 등록 및 자동 실행 설정

    bash복사편집sudo systemctl daemon-reexec
    sudo systemctl daemon-reload
    sudo systemctl enable update.service
    sudo systemctl start update.service
    

    ✅ 3. 상태 확인

    bash복사편집sudo systemctl status update.service
  • 관리

    용산초

    @급식

    @링크: 할일목록 | https://qer.kr/check

    @링크: 독서감상문 | https://b.tkbell.co.kr/tkboard/woi/0001257554/Pca5B1Ogzc.do?pageSeq=1818029

    @링크: 게임코딩 검사도구(비번1890) | https://data4u.gabia.io/wordpress/25-%ea%b2%8c%ec%9e%84-%ec%bd%94%eb%94%a9-%ea%b2%80%ec%82%ac%eb%8f%84%ea%b5%ac/

    @링크: 띵커벨 | https://b.tkbell.co.kr/tkboard/woi/1257554/Pca5B1Ogzc.do?pageSeq=1764824

    @링크: 마크 다운 | https://downloads.minecrafteduservices.com/retailbuilds/Msi/x86/MinecraftEducation_x86_1.21.1000.0.exe

    @메모: 마인크래프트 | a106@hicomputing.org mc12345!2 // a107@hicomputing.org mc12345!2 // a108@hicomputing.org mc12345!2 // a109@hicomputing.org mc12345!2 // a110@hicomputing.org mc12345!2 // a111@hicomputing.org mc12345!2 // a112@hicomputing.org mc12345!2 // a113@hicomputing.org mc12345!2 // a114@hicomputing.org mc12345!2 // a115@hicomputing.org mc12345!2 // a116@hicomputing.org mc12345!2 // a117@hicomputing.org mc12345!2 //

    @링크: 기초학력 진단시스템 | https://basic.jbedu.kr/

    @메모: 기초학력 아이디 | 335325040101 // 335325040102 // 335325040103 // 335325040104 // 335325040105 // 335325040106 // 335325040107 // 335325040108 // 335325040109 // 335325040110 // 335325040111 // 22is19e000!!

    @링크: AIDT | https://www.aidtbook.kr/

    @메모: AIDT 디지털원패스 | 이름 아이디 // 비번 김지은 kjh1130 // 22is19e001!! 손지호 jiho8514 // !62342649A@ 윤재하 yoonjaeha // 22is19e003!! 이서진 smile777 // 22is19e004!! 이수빈 subin486 // 22is19e005!! 이정아 jaa3518 //22is19e006!! 이찬회 lch1109 // 22is19e007!! 조범준 cbj0913 // 22is19e008!! 한나연 nayeoncap1 // 22is19e009!! 홍제희 jehui15 // 22is19e010!! 황인성 IN0307 // 22is19e011!!

    @링크: 캔바 | https://www.canva.com/

    @링크: 투닝 | https://tooning.io/

    @메모: 투닝(환경)폴더 | 162503@2259637

    @메모: 투닝(표어)폴더 | 162503@2186949

    @링크: 웨일스페이스 | https://whalespace.io/

    @메모: 웨일스페이스 | 22is19e001@n.jbedu.kr 22is19e001!! 22is19e002@n.jbedu.kr 22is19e002!! 22is19e003@n.jbedu.kr 22is19e003!! 22is19e004@n.jbedu.kr 22is19e004!! 22is19e005@n.jbedu.kr 22is19e005!! 22is19e006@n.jbedu.kr 22is19e006!! 22is19e007@n.jbedu.kr 22is19e007!! 22is19e008@n.jbedu.kr 22is19e008!! 22is19e009@n.jbedu.kr 22is19e009!! 22is19e010@n.jbedu.kr 22is19e010!! 22is19e011@n.jbedu.kr 22is19e011!!

    @링크: AI러닝 평가 | https://ai.classting.com/home

    @링크: 웍스 메세지 | https://talk.worksmobile.com/

    @링크: 클래스팅AI | https://newclass.classting.com/classrooms/2uCBPXiUqQPivcDNeAJvjte0wFV/

    @링크: 틴커캐드 | https://www.tinkercad.com/joinclass/F5X4PDYJX

  • 급식

    2025-05-09 급식 정보





    오늘의 급식

    🍱 오늘의 급식

    5월 9일 금요일

    친환경기장잡곡밥
    바지락순두부국 (1.5.18)
    찜닭 (5.6.13.15.18)
    오징어애호박전 (1.5.6.17)
    배추김치 (9)
    과일푸딩 (2)
    보코치니샐러드 (1.2.5.6.12)
    공통양념 (5.6.13)


  • 단축 주소

    마인크래프트 에듀케이션

    설문 추가

    2025 교실 속 게임리터러시 상반기 참여학급 선생님들을 대상으로 게임리터러시 교육 효과성 검증 검사를 안내드립니다.
    참고로 ‘게임리터러시 교육 효과성 검증 검사’는 5월 14일 이후부터 교육을 시작하시는 참여학급 선생님들께서 필수로 진행해주셔야 하는 검사이며, 정확한 검사 진행을 위해 교육 효과성 검사 관련 교사연수 영상&자료를 확인하시어 내용을 숙지 후 효과성 검증 검사에 참여 부탁드립니다. 🙂

    1. 사전 검사 연수 녹화본 및 자료
    5월 14일 (수)에 진행된 연수 녹화본과 자료를 공유드립니다.
    원활한 검사 진행을 위해 사전 검사 실시 전 연수 영상 확인을 부탁드립니다.
    – 연수 녹화본https://drive.google.com/file/d/102tD39pNmof3AMwyRVDJxeZghIDEdSX8/view?usp=sharing
    – 연수 자료https://drive.google.com/file/d/1HLE4khS5AmAUWsuJ7MtVQs0WBABfbA-i/view?usp=sharing

    2. 사전 검사 안내1) ★게임활용 코딩 교육 검사 URL(사전검사)
    – 사전 검사 사이트https://m.site.naver.com/1HsKj  / QR코드 첨부파일 확인
    – 비밀번호: 1790

    2) 검사 참여 대상
    – 2025 교실 속 게임 리터러시 사업 참여학급: 5/14 이후 교육 시작하는 학급만 사전-사후 검사 참여
    – 헬로메이플 선도연구회: 사전-사후 검사 필수 참여
    *특수학급 => 검사 대상 제외

    3. ★사전검사 문항 관련 안내사항1) ★개인정보(학교, 학년, 반, 이름)을 정확하게 입력합니다!
    2) ★검사지 이름(사전 / 사후검사)을 잘 확인하고 시작합니다!
    3) 설문문항(1~27번 문제)은 5분 내외로 풀고 다음 쪽의 문제를 푸는 것을 권장합니다.
    4) 설문문항(1~27번 문제)을 학생들이 잘 이해하지 못하는 경우, 선생님들의 충분한 설명을 부탁드립니다!
    5) 28~37번 문제는 문제풀이 형식으로 학생들이 스스로 해결할 수 있도록 해주세요.
    6) ★제한시간을 최대한 끝까지 사용하여 문제를 풀고, 제출 전 검토할 수 있도록 해주세요!!
    7) 문제를 다 풀기 전에 제한 시간이 끝나는 경우, 마지막으로 푼 문제까지 자동으로 제출됩니다.
    8) 검사는 1회만 참여하며, 정규 수업 시간 내에 실시해주세요.(가정에서 과제로 참여X)

    연수물

    https://drive.google.com/file/d/1HLE4khS5AmAUWsuJ7MtVQs0WBABfbA-i/view

    <링크> 1. 일반학급 설문조사
    ① 사전
    – 교사
    https://docs.google.com/forms/d/e/1FAIpQLSf2C7PdcF_kEetMZ-N-_D-oT7HXg1RtU_7-sBKaJwZKo6sFyw/viewform?usp=header
    – 학생
    https://docs.google.com/forms/d/e/1FAIpQLSfB_ReuKwt7OJIgme_SpG53b6a-iKHR2VGXlcx9oB1BZSj7Dg/viewform?usp=header

    ② 사후
    – 교사
    https://docs.google.com/forms/d/e/1FAIpQLSeJrY4WhfM912MxSXKYHG70v7MH4gmr8hnN-UjUEUH_-RtVxQ/viewform?usp=header
    – 학생
    https://docs.google.com/forms/d/e/1FAIpQLSeu5hCRqCpubUOleMuqHnQfZ3AnMTJJox-j-m5r5y7BykDy8A/viewform?usp=header

    자료 목록

    https://drive.google.com/drive/folders/11AEdoSbT4nTZY_dTKUUMxibCRVGvv4Vv?usp=sharing

    1. 강사 이력 카드
    2. 게임활용 코딩 결과 보고서
    3. 운영계획
    4. 교사용 지도안
    5. 학생용 교재

    결과보고서 제출방법

    수업 진행 후 작성해주셔야 하는 보고서입니다.

    1. 드라이브 링크에서 보고서 양식을 다운로드 
    https://drive.google.com/file/d/1FmDBR0M7R35EnMlxU8iuvZWRAW68Ps70/view?usp=drive_link

    2. 결과 보고서 작성(4차시 中 2차시만 작성/ 수업 결과1, 2)

    3. ‘안내 보기’ -> 오른쪽 상단  ‘+ 추가 또는 생성’ 클릭 -> ‘파일’ 클릭 -> ‘업로드’ 클릭 ->  결과 보고서 업로드 -> 제출

    *서류 제출 기한 : (수업 종료 후 일주일 이내) ~7월 11일

  • 개발

    리틀리 가져오기

    
    <?php
    header("Content-Type: text/html; charset=UTF-8");
    
    // 외부 페이지 URL
    $url = "https://litt.ly/yongsan";
    
    // cURL로 외부 페이지 요청
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);  // 리디렉션 따라감
    $html = curl_exec($ch);
    curl_close($ch);
    
    // 결과 출력
    echo $html;
    ?>

    1:3 배치

    <!DOCTYPE html>
    <html lang="ko">
    <head>
      <meta charset="UTF-8">
      <title>용산초 링크 & 급식</title>
      <style>
        body {
          margin: 0;
          padding: 0;
          font-family: sans-serif;
        }
        .container {
          display: flex;
          height: 100vh;
        }
        .left {
          flex: 1;
          border-right: 1px solid #ccc;
          overflow: hidden;
        }
        .right {
          flex: 3;
          overflow: hidden;
        }
        iframe {
          width: 100%;
          height: 100%;
          border: none;
        }
      </style>
    </head>
    <body>
    
    <div class="container">
      <div class="right">
        <iframe src="https://qer.kr/yongsan-proxy.php"></iframe>
      </div>
      <div class="left">
        <iframe src="https://qer.kr/lunch.html"></iframe>
      </div>
    </div>
    
    </body>
    </html>
    
  • 급식

    2025-05-08 급식 정보





    오늘의 급식

    🍱 오늘의 급식

    5월 8일 목요일

    친환경녹미밥
    문어매운탕
    청경채나물
    삼색비엔나야채볶음 (1.2.5.6.10.15.16)
    수제떡갈비 (5.6.10.12.13.15.16.18)
    배추김치 (9)
    아이스망고
    공통양념 (5.6.13)


  • 개발

    파이썬 설치

    pip install python-wordpress-xmlrpc requests beautifulsoup4 lxml –break-system-packages

    오라클 클라우드 우분투에서 pip로 설치시 에러뜰때.

    python3 -c “from wordpress_xmlrpc import Client; import bs4; import requests; print(‘✅ OK’)”

    설치 후 확인

    xmlrpc.php

    워드프레스 자동 포스팅용

    급식용

    import requests
    from bs4 import BeautifulSoup

    url = “https://school.jbedu.kr/yongsan4u/M010304/”
    res = requests.get(url)
    soup = BeautifulSoup(res.text, “lxml”)

    date = soup.find(“ul”, class_=”tch-lnc-date”).get_text(strip=True)

    줄바꿈 처리된 급식 메뉴 추출

    meal_items = soup.select(“dd.tch-lnc li”)
    if meal_items:
    data = “
    “.join([item.get_text(strip=True) for item in meal_items])
    else:
    no_data = soup.find(“div”, class_=”tch-no-data”)
    data = “급식이 없습니다.” if no_data else “정보를 불러오지 못했습니다.”

    html = f”””

    오늘의 급식

    🍱 오늘의 급식

    {date}

    {data}
    “””

    with open(“/home/ubuntu/www/lunch.html”, “w”, encoding=”utf-8″) as f:
    f.write(html)

    워드프레스 업로드

    from wordpress_xmlrpc import Client, WordPressPost
    from wordpress_xmlrpc.methods.posts import NewPost
    import datetime

    1. 워드프레스 로그인 정보 설정

    wp_url = “https://xmlrpc.php”
    wp_username = “”
    wp_password = “”
    client = Client(wp_url, wp_username, wp_password)

    2. HTML 파일 읽기

    html_path = “/var/www/html/lunch.html”
    with open(html_path, “r”, encoding=”utf-8″) as f:
    html_content = f.read()

    3. 오늘 날짜 가져오기

    today = datetime.date.today().strftime(“%Y-%m-%d”)

    4. 워드프레스 글 작성

    post = WordPressPost()
    post.title = f”{today} 급식 정보”
    post.content = html_content
    post.post_status = “publish”
    post.terms_names = {
    ‘category’: [‘급식’],
    ‘post_tag’: [‘점심’, ‘학교’]
    }

    5. 업로드 실행

    client.call(NewPost(post))
    print(“✅ 워드프레스에 급식 정보 게시 완료!”)

    크론탭

    crontab -e

    30 8 * * 1-5 /var/www/html/run_lunch.sh >> /var/www/html/lunch_log.txt 2>&1

    월 금 8:30 시행