├── README.md ├── requirements.txt ├── .github └── workflows │ ├── clear.yml │ └── update.yml └── main.py /README.md: -------------------------------------------------------------------------------- 1 | # free-node 2 | Moved to [mheidari98/.proxy](https://github.com/mheidari98/.proxy) 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | proxyUtil @ git+https://github.com/mheidari98/proxyUtil@6492ac4b5c09f5df443e855e7b8488a0aff1ecff 2 | -------------------------------------------------------------------------------- /.github/workflows/clear.yml: -------------------------------------------------------------------------------- 1 | name: Delete Commit Records Weekly 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # runs at 00:00 on Friday 7 | # https://crontab.guru/#0_0_*_*_5 8 | - cron: '0 0 * * 5' 9 | 10 | jobs: 11 | delete-commit-records: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | 17 | - name: Delete commit records 18 | run: | 19 | git config --local user.email "mahdih3idari@gmail.com" 20 | git config --local user.name "mheidari98" 21 | git checkout --orphan new_branch 22 | git commit -m "init" 23 | git branch -D main 24 | git branch -m main 25 | git push -f origin main 26 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from proxyUtil import * 2 | 3 | def checkURL(url): 4 | try: 5 | r = requests.head(url, timeout=3) 6 | except: 7 | return False 8 | return r.status_code//100 == 2 9 | 10 | output = [] 11 | with open("README.md") as file: 12 | cnt = 0 13 | while line := file.readline(): 14 | line = line.rstrip() 15 | if line.startswith("|"): 16 | if cnt>1 : 17 | url = line.split('|')[-2] 18 | for _ in range(3): 19 | if status := checkURL(url): 20 | break 21 | if status : 22 | count = len(ScrapURL(url)) 23 | line = re.sub(r'^\|+?(.*?)\|+?(.*?)\|+?', f'| ✅ | {count} |', line, count=1) 24 | else: 25 | line = re.sub(r'^\|+?(.*?)\|+?(.*?)\|+?', f'| ❌ | - |', line, count=1) 26 | cnt+=1 27 | output.append(line) 28 | 29 | with open("README.md", "w") as f: 30 | f.write('\n'.join(output)) 31 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: update README.md 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'README.md' 7 | schedule: 8 | - cron: '0 */1 * * *' # @hourly 9 | 10 | jobs: 11 | updateREADME: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | 16 | # https://github.com/actions/checkout 17 | - uses: actions/checkout@v3 18 | 19 | - name: setup python 20 | uses: actions/setup-python@v4 21 | with: 22 | python-version: '3.10' 23 | cache: 'pip' 24 | 25 | - name: install python packages 26 | run: | 27 | python -m pip install --upgrade pip 28 | pip install -r requirements.txt 29 | 30 | - name: execute py script 31 | run: python main.py 32 | 33 | - name: Get current date 34 | id: date 35 | #run: echo "::set-output name=date::$(TZ=Asia/Tehran date +'%s')" 36 | run: echo "date=$(TZ=Asia/Tehran date +'%Y/%m/%d %R')" >> $GITHUB_OUTPUT 37 | 38 | # https://github.com/stefanzweifel/git-auto-commit-action 39 | - uses: stefanzweifel/git-auto-commit-action@v4 40 | id: auto-commit-action 41 | with: 42 | commit_message: "Update README.md at ${{ steps.date.outputs.date }}" 43 | commit_options: '--no-verify --signoff' 44 | commit_user_name: "mheidari98" 45 | commit_user_email: "mahdih3idari@gmail.com" 46 | # commit_author: Author 47 | 48 | 49 | --------------------------------------------------------------------------------