Skip to content

Commit 85f02b3

Browse files
committed
init
0 parents  commit 85f02b3

File tree

167 files changed

+30040
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+30040
-0
lines changed

.github/workflows/actions.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: py_scripts
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
- cron: 0 2,14 * * *
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-18.04
15+
strategy:
16+
max-parallel: 5
17+
matrix:
18+
python-version: [3.7]
19+
#python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
- name: Install SeleniumBase
32+
run: |
33+
python setup.py install
34+
# - name: Lint with flake8
35+
# run: |
36+
# pip install flake8
37+
# # Stop the build if there are flake8 issues
38+
# flake8 . --count --show-source --statistics --exclude=temp
39+
- name: Install Chrome and Firefox
40+
run: |
41+
sudo apt install google-chrome-stable
42+
sudo apt-get install firefox
43+
- name: Install chromedriver and geckodriver (Firefox Webdriver)
44+
run: |
45+
seleniumbase install chromedriver
46+
seleniumbase install geckodriver
47+
#- name: Make sure pytest is working
48+
# run: |
49+
# echo "def test_1(): pass" > nothing.py
50+
# pytest nothing.py
51+
52+
# 天翼云盘签到+抽奖
53+
- name: Cloud 189 Checkin
54+
env:
55+
CLOUD189_USER: ${{ secrets.CLOUD189_USER }}
56+
CLOUD189_PWD: ${{ secrets.CLOUD189_PWD }}
57+
run: |
58+
bash scripts/_C189.sh
59+
60+
# HostLoc 赚积分
61+
- name: 'HostLoc Get points'
62+
env:
63+
HOSTLOC_USERNAME: ${{ secrets.HOSTLOC_USERNAME }}
64+
HOSTLOC_PASSWORD: ${{ secrets.HOSTLOC_PASSWORD }}
65+
run: python scripts/hostloc/hostloc_get_points.py
66+
67+
# TextNow保号任务
68+
- name: textnow protect number
69+
env:
70+
TEXTNOW_USERNAME: ${{ secrets.TEXTNOW_USERNAME }}
71+
TEXTNOW_PASSWORD: ${{ secrets.TEXTNOW_PASSWORD }}
72+
TEXTNOW_NUMBER: ${{ secrets.TEXTNOW_NUMBER }}
73+
TEXTNOW_MSG: ${{ secrets.TEXTNOW_MSG }}
74+
run: |
75+
python scripts/_textnow.py

.gitignore

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Compiled Python Bytecode
2+
*.py[cod]
3+
4+
# Packages
5+
*.egg
6+
*.egg-info
7+
dist
8+
build
9+
ghostdriver.log
10+
eggs
11+
parts
12+
bin
13+
var
14+
sdist
15+
develop-eggs
16+
.installed.cfg
17+
lib
18+
lib64
19+
__pycache__
20+
21+
# Python3 pyvenv
22+
env
23+
venv
24+
sbase
25+
sbase*
26+
pyvenv.cfg
27+
.Python
28+
include
29+
pip-delete-this-directory.txt
30+
pip-selfcheck.json
31+
ipython.1.gz
32+
nosetests.1
33+
34+
# Installer logs
35+
pip-log.txt
36+
.swp
37+
38+
# Unit test / coverage reports
39+
.coverage
40+
.tox
41+
nosetests.xml
42+
43+
# py.test
44+
.cache/*
45+
.pytest_cache/*
46+
*.py[cod]
47+
.pytest_config
48+
49+
# Azure Pipelines
50+
junit
51+
test-results.xml
52+
53+
# Developer
54+
.idea
55+
.project
56+
.pydevproject
57+
.vscode
58+
59+
# Web Drivers
60+
chromedriver
61+
geckodriver
62+
msedgedriver
63+
operadriver
64+
MicrosoftWebDriver.exe
65+
IEDriverServer.exe
66+
chromedriver.exe
67+
geckodriver.exe
68+
msedgedriver.exe
69+
operadriver.exe
70+
71+
# Logs
72+
logs
73+
latest_logs
74+
log_archives
75+
archived_logs
76+
geckodriver.log
77+
pytestdebug.log
78+
79+
# Reports
80+
latest_report
81+
report_archives
82+
archived_reports
83+
html_report.html
84+
report.html
85+
report.xml
86+
87+
# Presentations
88+
presentations_saved
89+
saved_presentations
90+
91+
# Tours
92+
tours_exported
93+
94+
# Images
95+
images_exported
96+
97+
# Cookies
98+
saved_cookies
99+
100+
# Automated Visual Testing
101+
visual_baseline
102+
103+
# MkDocs
104+
site/*
105+
docs/*.md
106+
docs/*/*.md
107+
docs/*/*/*.md
108+
docs/*/*/*/*.md
109+
110+
# Other
111+
selenium-server-standalone.jar
112+
proxy.zip
113+
verbose_hub_server.dat
114+
verbose_node_server.dat
115+
ip_of_grid_hub.dat
116+
downloaded_files
117+
archived_files
118+
assets
119+
temp
120+
temp*
121+
node_modules

Dockerfile

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SeleniumBase Docker Image
2+
FROM ubuntu:18.04
3+
4+
#=======================================
5+
# Install Python and Basic Python Tools
6+
#=======================================
7+
RUN apt-get update && apt-get install -y python python-pip python-setuptools python-dev python-distribute
8+
9+
#=================================
10+
# Install Bash Command Line Tools
11+
#=================================
12+
RUN apt-get -qy --no-install-recommends install \
13+
sudo \
14+
unzip \
15+
wget \
16+
curl \
17+
libxi6 \
18+
libgconf-2-4 \
19+
vim \
20+
xvfb \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
#================
24+
# Install Chrome
25+
#================
26+
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
27+
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
28+
apt-get -yqq update && \
29+
apt-get -yqq install google-chrome-stable && \
30+
rm -rf /var/lib/apt/lists/*
31+
32+
#==================
33+
# Configure Chrome
34+
#==================
35+
RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome && \
36+
echo "#!/bin/bash\nexec /opt/google/chrome/google-chrome.real --disable-setuid-sandbox --no-sandbox \"\$@\"" > /opt/google/chrome/google-chrome && \
37+
chmod 755 /opt/google/chrome/google-chrome
38+
39+
#=================
40+
# Install Firefox
41+
#=================
42+
RUN apt-get -qy --no-install-recommends install \
43+
$(apt-cache depends firefox | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ') \
44+
&& rm -rf /var/lib/apt/lists/* \
45+
&& cd /tmp \
46+
&& wget --no-check-certificate -O firefox-esr.tar.bz2 \
47+
'https://download.mozilla.org/?product=firefox-esr-latest&os=linux64&lang=en-US' \
48+
&& tar -xjf firefox-esr.tar.bz2 -C /opt/ \
49+
&& ln -s /opt/firefox/firefox /usr/bin/firefox \
50+
&& rm -f /tmp/firefox-esr.tar.bz2
51+
52+
#===========================
53+
# Configure Virtual Display
54+
#===========================
55+
RUN set -e
56+
RUN echo "Starting X virtual framebuffer (Xvfb) in background..."
57+
RUN Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
58+
RUN export DISPLAY=:99
59+
RUN exec "$@"
60+
61+
#=====================
62+
# Set up SeleniumBase
63+
#=====================
64+
COPY seleniumbase /SeleniumBase/seleniumbase/
65+
COPY examples /SeleniumBase/examples/
66+
COPY integrations /SeleniumBase/integrations/
67+
COPY requirements.txt /SeleniumBase/requirements.txt
68+
COPY setup.py /SeleniumBase/setup.py
69+
RUN find -name '*.pyc' -delete
70+
RUN find -name __pycache__ -delete
71+
RUN pip install --upgrade pip
72+
RUN pip install --upgrade setuptools
73+
RUN pip install --upgrade setuptools-scm
74+
RUN cd /SeleniumBase && ls && pip install -r requirements.txt --upgrade
75+
RUN cd /SeleniumBase && python setup.py develop
76+
RUN seleniumbase install chromedriver
77+
RUN seleniumbase install geckodriver
78+
79+
#==========================================
80+
# Create entrypoint and grab example tests
81+
#==========================================
82+
COPY integrations/docker/docker-entrypoint.sh /
83+
COPY integrations/docker/run_docker_test_in_firefox.sh /
84+
COPY integrations/docker/run_docker_test_in_chrome.sh /
85+
RUN chmod +x *.sh
86+
COPY integrations/docker/docker_config.cfg /SeleniumBase/examples/
87+
ENTRYPOINT ["/docker-entrypoint.sh"]
88+
CMD ["/bin/bash"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Michael Mintz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
include README.md
2+
include pytest.ini
3+
include setup.cfg
4+
include .gitignore
5+
include requirements.txt
6+
include install.sh
7+
include install.bat
8+
include virtualenv_install.sh
9+
include virtualenv_install.bat
10+
include seleniumbase/core/create_db_tables.sql
11+
include seleniumbase/extensions/*.zip
12+
include seleniumbase/utilities/selenium_grid/grid-hub
13+
include seleniumbase/utilities/selenium_grid/grid-node
14+
include seleniumbase/utilities/selenium_grid/font_color
15+
include seleniumbase/utilities/selenium_grid/start-grid-hub.bat
16+
include seleniumbase/utilities/selenium_grid/register-grid-node.bat
17+
include seleniumbase/utilities/selenium_grid/start-grid-hub.sh
18+
include seleniumbase/utilities/selenium_grid/register-grid-node.sh

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
python脚本集,支持selenium,基于[SeleniumBase](https://github.com/seleniumbase/SeleniumBase)项目
2+
3+
当前功能:
4+
5+
1. [TextNow保号](<https://github.com/Arronlong/py_scripts/tree/master/scripts/textnow>)
6+
2. [HostLoc赚积分](<https://github.com/Arronlong/py_scripts/tree/master/scripts/hostloc>)
7+
3. [天翼云盘签到+抽奖](<https://github.com/Arronlong/py_scripts/tree/master/scripts/C189>)
8+
9+
功能对应的参数,请点击后自行查看。
10+
11+
根据需要自行修改.github/workflows/actions.yml进行任务定制
12+
13+
---
14+
15+
# Github Actions说明
16+
17+
## 一、Fork此仓库(已fork的无需再次fork)
18+
19+
![](http://tu.yaohuo.me/imgs/2020/06/f059fe73afb4ef5f.png)
20+
21+
## 二、设置Secret参数
22+
23+
根据需要添加对应任务的参数,参数说明请直接点上面的链接进行查看。
24+
![](http://tu.yaohuo.me/imgs/2020/06/748bf9c0ca6143cd.png)
25+
26+
## 三、启用Action
27+
28+
1 点击**Action**,再点击**I understand my workflows, go ahead and enable them**
29+
2 修改任意文件后提交一次
30+
![](http://tu.yaohuo.me/imgs/2020/06/34ca160c972b9927.png)
31+
32+
## 四、查看运行结果
33+
34+
Actions > py_scripts > build
35+
能看到如下图所示,表示成功
36+
![](https://cdn.jsdelivr.net/gh/Arronlong/cdn/blogImg/20200705173742.png)
37+
38+
此后,将会在每天2:00和14:00各发送一次
39+
若有需求,可以在[.github/workflows/actions.yml]中自行修改,**【此配置所有任务共享,修改需谨慎】**
40+

0 commit comments

Comments
 (0)