Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/visit-page.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Visit Page Daily
name: Visit GitHub Page

on:
workflow_dispatch: # Allows manual trigger from GitHub Actions UI
schedule:
- cron: '0 0 * * *' # Runs once daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
- cron: '0 * * * *' # Runs every hour; adjust as needed

jobs:
visit_page_job:
visit-page:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,10 +16,14 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Ensure Node.js version is compatible
node-version: 'lts/*' # Installs the latest LTS version of Node.js

- name: Install dependencies
run: npm install
run: npm install selenium-webdriver

- name: Run the visit script
run: node scripts/visit.js # Replace with the actual path if necessary
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1

- name: Run Visit Script
run: |
node scripts/visit.js
11 changes: 3 additions & 8 deletions scripts/visit.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');

// URL to visit
const url = 'https://github.com/yashksaini-coder'; // Replace with your desired URL
const url = 'https://github.com/yashksaini-coder';

(async function visitPage() {
// Set up Chrome options for fast execution
let options = new chrome.Options();
options.addArguments('--headless'); // Run in headless mode
options.addArguments('--headless');
options.addArguments('--disable-infobars');
options.addArguments('--disable-extensions');
options.addArguments('--no-sandbox');
options.addArguments('--disable-gpu');
options.addArguments('--disable-dev-shm-usage');

// Initialize WebDriver
let driver = await new Builder().forBrowser('chrome').setChromeOptions(options).build();

try {
// Visit the URL 1000 times
for (let i = 0; i < 1000; i++) {
for (let i = 0; i < 500; i++) { // Reduced visits to avoid excessive requests
console.log(`Visit ${i + 1} to ${url}`);
await driver.get(url);
}
} finally {
// Close the browser after completion
await driver.quit();
}
})();