diff --git a/.github/workflows/gen_nofarm.yml b/.github/workflows/gen_nofarm.yml new file mode 100644 index 0000000..2310cfd --- /dev/null +++ b/.github/workflows/gen_nofarm.yml @@ -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 }} diff --git a/AutoBuild/hide_farm.py b/AutoBuild/hide_farm.py new file mode 100644 index 0000000..c63930b --- /dev/null +++ b/AutoBuild/hide_farm.py @@ -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)