mirror of
https://github.com/FutaGuard/LowTechFilter.git
synced 2025-06-21 05:21:02 +08:00
✨ autobuild tools
This commit is contained in:
parent
ae49aee501
commit
b3a89fb6af
35
.github/workflows/gen_nofarm.yml
vendored
Normal file
35
.github/workflows/gen_nofarm.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
name: Hide_FarmContent_From_Search
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Run AutoBuild
|
||||
run: |
|
||||
cd AutoBuild
|
||||
python hide_farm.py
|
||||
|
||||
- name: Commit files
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add hide_farm_from_search.txt
|
||||
git commit -m "AutoBuild"
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.FUTAFILTERAUTOBUILD }}
|
11
AutoBuild/hide_farm.py
Normal file
11
AutoBuild/hide_farm.py
Normal file
@ -0,0 +1,11 @@
|
||||
domain_list = ''
|
||||
with open('../nofarm_hosts.txt', 'r') as files:
|
||||
for domains in files.read().split('\n'):
|
||||
if domains:
|
||||
domain = domains[2:-1]
|
||||
domain_list += 'google.*##div.g:has(a[href*="{domain}"])\n'.format(
|
||||
domain=domain
|
||||
)
|
||||
|
||||
with open('../hide_farm_from_search.txt', 'w') as files:
|
||||
files.write(domain_list)
|
Loading…
x
Reference in New Issue
Block a user