GithubHelp home page GithubHelp logo

zhaoqi99 / school_notice Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 14.98 MB

应用Python对校园各类网站的通知更新进行短信,邮件提醒。(An application of using python to check notifications update for various campus website,and send SMS reminder,email reminder.)

License: GNU General Public License v3.0

Python 100.00%
spider snnu smtplib twillio

school_notice's Introduction

Language: 🇺🇸 🇨🇳

School_Notice


Build Status Release License GitHub forks GitHub stars

Introduction

An application of using python to check notifications update for various campus website,and send SMS reminder,email reminder.

features

  • Notification update SMS reminder
  • Notification update email reminder
  • Simultaneous reminders for multiple people
  • Send log、check udate log
  • log function optional
  • The department which each user need to be reminded is optional
  • Database storage/file storge

Dependencies

Using script

  1. Using command to clone the the repository to local folder git clone https://github.com/ZhaoQi99/School_Notice.git
  2. Apply for Twilio Free trial account
  3. Edit the configs.py file to modify the configuration file.
  4. Run the main.py file

Configuration

You can (and should) modify a couple of settings. if you do not need to use the twilio/Mail reminder feature, keep the default.

Send Email Config

Fill in the sender's e-mail address, password, port, and SMTP server address in turn

FROM_ADDR = ""
PASSWORD = ""
EMAIL_PORT = 0
EMAIL_SERVER = ''

Twillo Config

The following parameters can be found on the personal information page of the Twilio account.

ACCOUNT_ID = ''
AUTH_TOKEN = ''
TWILIO_NUMBER = ''

Show Config

Content which is displayed in the window,including: school Name, script version, author name, author email

SCHOOL_NAME = ''
VERSION = ''
AUTHOR_NAME = ''
AUTHOR_EMAIL = ''

Log Config

Whether logs can be logged in the log file, which is true by default

LOG_ENABLED = True

Save Type Config

The type of storging data,including file storge,mysql storge

SAVE_TYPE = 'MYSQL'
SAVE_TYPE = 'File'

Show Right Config

Whether show the information of copyright.

SHOW_RIGHT = False

Spider Config

Crawler configuration,including: department type (EN), department type (CN), "more notifications " page link, link public part, regular expression, Web page encoding format,type(notice/news) department_EN: File name of data file department_CN: Used to display in logs, message headers Warning: There must be three groups in the regular expression, which the name must be link,date,title Such as:info/1085/(?P<link>\d+\.htm)" target="_blank">(?P<title>[\s\S]{5,100})((?P<date>\d*-\d*-\d*))

SPIDER_CONFIG = [
	{
	    'department_EN': '',
	    'department_CN': '',
	    'url': '',
	    'url_main': '',
	    'rule': '',
	    'coding': '',
	    'type': '' 
	},
	{
	    'department_EN': '',
	    'department_CN': '',
	    'url': '',
	    'url_main': '',
	    'rule': '',
	    'coding': '',
	    'type': '' 
	}
]

Here is an example about crawler configuration:

Example

SPIDER_CONFIG = [
    {
        'department_EN': 'snnu_index',
        'department_CN': '学校主页',
        'url': 'http://www.snnu.edu.cn/tzgg.htm',
        'url_main': 'http://www.snnu.edu.cn/info/1085/',
        'rule': 'info/1085/(?P<link>\d+\.htm)" target="_blank">(?P<title>[\s\S]{5,100})((?P<date>\d*-\d*-\d*))',
        'coding': 'utf-8',
        'type': '通知'
    },
    {
        'department_EN': 'snnu_index',
        'department_CN': '学校主页',
        'url': 'http://www.snnu.edu.cn/sdxw.htm',
        'url_main': 'http://www.snnu.edu.cn/info/1084/',
        'rule': 'info/1084/(?P<link>\d+.htm)" target="_blank" title="(?P<title>[^"]+?)"><[^<]+?<[^<]+?<[^<]+?<p class="qh-wide-pushtime">(?P<date>\d*-\d*-\d*)',
        'coding': 'utf-8',
        'type': '新闻' 
    }
]

Packaging exe(Windows)

  1. Install pywin32 pip install pywin32
  2. Install Pyinstaller pip install PyInstaller
  3. (optional)Move the program icon to the current folder, renamed ' Logo.ico
  4. Using pyinstaller package program pyinstaller -F main.pyOrpyinstaller -F -i logo.ico main.py
  5. Go to the Dist folder and you can see the Main.exe cd dist

Contributors

Thanks goes to these wonderful people (emoji key):


Keyi Xie

💻 📖

jhy

💻 📖

License & Author

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.