Code Monkey home page Code Monkey logo

githubactionsample's Introduction

Github Action功能样例

原理:使用Github Action功能,运行python程序,实现无服务器的免费任务,比如天气推送,薅羊毛,签到

视频教程

https://www.bilibili.com/video/BV11e411i7Xx/

作者 技术爬爬虾 全网同名,转载请注明作者

Part1 构建画爱心为可执行程序

Fork本项目

构架Windows 可执行程序: Actions-->画爱心Windows版-->run work flow-->结束后查看结果 -->Artifacts-->下载love_heart

构架Ubuntu 可执行程序: Actions-->画爱心Ubuntu版-->run work flow-->结束后查看结果 -->Artifacts-->下载love_heart

构架MacOS 可执行程序: Actions-->画爱心MacOS版-->run work flow-->结束后查看结果 -->Artifacts-->下载love_heart

Part2 天气推送

申请公众号测试账户

使用微信扫码即可 https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login

进入页面以后我们来获取到这四个值

appID appSecret openId template_id

image

想让谁收消息,谁就用微信扫二维码,然后出现在用户列表,获取微信号(openId) image

新增测试模板获得 template_id(模板ID) image

模板标题随便填,模板内容如下,可以根据需求自己定制

模板内容:

今天:{{date.DATA}} 
地区:{{region.DATA}} 
天气:{{weather.DATA}} 
气温:{{temp.DATA}} 
风向:{{wind_dir.DATA}} 
对你说的话:{{today_note.DATA}}

项目配置

Fork本项目 进入自己项目的Settings ----> Secrets and variables ---> Actions --> New repository secret 配置好以下四个值(见上文)

image

进入自己项目的Action ----> 天气预报推送 ---> weather_report.yml --> 修改cron表达式的执行时间 image

Part3 签到薅羊毛

Fork本项目 网页上打开:www.jd.com/ 再按F12打开控制台,再点击切换模式,切换到手机模式,刷新一下页面。如图所示 image 在网络->m.jd.com找到Cookie

image

将其填入 Settings ----> Secrets and variables ---> Actions --> New repository secret -->新增JD_COOKIE image

进入自己项目的Action ----> 签到薅羊毛 ---> daily_sign.yml --> 修改cron表达式的执行时间

githubactionsample's People

Contributors

noobhumiliator avatar tech-shrimp avatar kwg520 avatar yltx 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.