Giter Club home page Giter Club logo

auto-read-liunxdo's Introduction

中文文档

Method 1: Tampermonkey Script

The Tampermonkey script can be accessed in the index_passage_list. You can find and install the script from Greasy Fork:

alt text Tampermonkey Script: Auto Read

Method 2: Headless Execution with Puppeteer

1. Setting Environment Variables

Set your username and password in the .env file.

2. Execution

For Windows

Run the following commands:

npm install
node .\pteer.js

For Linux (additional packages needed)

Install the required packages and run the same commands as for Windows:

sudo apt-get update
sudo apt install nodejs npm -y
sudo apt-get install -y wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Method 3: GitHub Actions for Daily Reading at Midnight

Modify the start time and duration as needed. The code is located in .github/workflows/cron_read.yaml.

1. Fork the Repository

2. Set Environment Variables

Set the username and password in the secrets of GitHub actions (variable names can be referred from .env). Note that setting the environment variables in .env here does not work for GitHub actions. alt text

3. Start the Workflow

Tutorial: Enable Automatic Updates

Method 4: Docker Execution

1. Immediate Execution

Clone the repository, set environment variables in docker-compose.yml, and run:

docker-compose up -d

To view logs:

docker-compose logs -f

2. Scheduled Execution

Set permissions and edit the crontab:

chmod +x cron.sh
crontab -e

Manually add the following entry (to execute daily at 6 AM, adjust the directory as needed):

0 6 * * * /root/auto-read-linuxdo/cron.sh  # Note this is a sample directory, change to your repository's cron.sh directory (use pwd to find your directory)

Additional Information

The external script is used for puppeteer and is modified from index_passage_list.js. Main modifications include removing buttons and setting automatic reading and liking to start by default:

localStorage.setItem("read", "true"); // Initially disables auto-scroll
localStorage.setItem("autoLikeEnabled", "true"); // Auto-liking is enabled by default

auto-read-liunxdo's People

Contributors

14790897 avatar yuwangi avatar imgbotapp avatar icpd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.