GithubHelp home page GithubHelp logo

sccp's Introduction

蛇口母港船票 自动爬取+推送通知

主要用于爬取蛇口母港-香港国际机场的船票,支持批量爬取以及Bark推送提醒。

注意⚠️:本项目仅供交流学习使用,请勿用于商业用途。同时,本系统只起到提醒作用,并不会自动帮您购买船票,请知悉。

安装

程序在Python 3.8与3.9测试通过。

安装依赖库:

pip install -r requirements.txt

使用

本程序的主要配置在main.py中设置。

# ==================================
# Global Settings
# Github Action
enable_gh_action = False  # 启用GitHub Action
# Bark Push
enable_bark = False  # 启用Bark推送
bark_token = ""  # Bark推送ID
# Ticket Stuff
startSite = "SK"  # 始发站点
endSite = "HKA"  # 目标站点
startDate = "2021-08-1"  # 船票搜索日期
endDate = "2021-08-30"
show_available_only = True  # 只显示有票的日期
# ==================================

配置完成后运行python3 main.py自动抓取相应日期的船票。

image

程序运行后将以Json格式输出数据。

Bark推送(iOS Only)

安装好bark app,复制测试URL中的key至main.py中的bark_token = ""并且将enable_bark = False改为True

Github Action定时任务

感谢@DolorHunter

在Github右上角,选择「Use this template」

image

选择一个炫酷的名字

image

在软件源创建好后,进入Action标签页,此时你应该能看见运行中的Action任务

image

在Jobs下面的Build中,点选Start Crawling and Barking查看软件爬取的船票信息

image

任务设置为每天凌晨自动运行,如果想要修改运行频率,请到这里进行修改

如果想手动运行:

在Action下Workflows选择Crawler,并在右侧选择Run Workflow即可。

image

未来计划(不一定填坑)

  • 加入Server Chan推送
  • 前端网页
  • 邮件推送

Credits

感谢tuixue.online 的灵感。

愿天下所有人都不用退学

sccp's People

Contributors

liupeiliang avatar

Watchers

James Cloos avatar  avatar

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.