✨ A collection of automation scripts for daily tasks like check-ins, lucky draws, and more.
-
Multiple Platform Support
- 95504
- Juejin - Daily check-in and lucky draw
- HiFiNi - Forum daily check-in
- IKuuu - Daily check-in
- Kengee - Daily check-in
- Luckin Coffee Shop - Daily check-in
-
Email Notifications - Get results via email
-
Command Line Interface - Easy to use and integrate
-
Configurable - Supports environment variables and command-line parameters
- Node.js >= 20.0.0
- npm or pnpm
# Install globally
npm install -g public_actions
# Or install locally
npm install public_actionspuba list
puba list --details # Show detailed informationpuba run <action> --email-user <USER> --email-pass <PASS> --email-to <TO> [options]--email-user <USER>: Email account (required)--email-pass <PASS>: Email password (required)--email-to <TO>: Email receiver (required)
- juejin:
--domain <DOMAIN>,--username <USERNAME>,--password <PASSWORD> - hifini:
--domain <DOMAIN>,--cookie <COOKIE> - ikuuu:
--username <USERNAME>,--password <PASSWORD> - kengee:
--username <USERNAME>,--password <PASSWORD> - luckincoffeshop:
--phone <PHONE>,--password <PASSWORD>
You can configure the tool in three ways:
- Command Line Arguments - Pass options directly when running the command
- Environment Variables - Set variables with
PUBA_prefix - JSON Configuration - Set
PUBA_CONFIGenvironment variable with JSON content
You can set up automatic scheduled execution of actions using GitHub Actions. Here's how:
-
Fork this repository to your GitHub account
-
Go to your repository's Settings > Secrets and variables > Actions
-
Add the following secrets:
USER- Email account for notificationsPASS- Email passwordTO- Email receiver- Action-specific secrets (e.g.,
COOKIEfor Juejin,DOMAINfor HiFiNi)
-
The workflows are already configured to run daily. You can adjust the schedule in the
.github/workflows/directory by modifying thecronexpression.
Each action has its own workflow file (e.g., juejin_helper.yml for Juejin). The default schedule is set to run at 00:01 AM Beijing time (UTC 16:01).
To add your own automation script, follow these steps:
- Create a new directory under
src/for your action (e.g.,src/myaction/) - Create the following files:
index.ts- Main entry point for your actionapi.ts- API calls specific to your action
- In
index.ts, implement your main logic and export a default function that accepts a config object - Use
config.get('<param>')to access configuration parameters - Use
config.email()to get email configuration - Build the project with
pnpm run build
Example structure for src/myaction/index.ts:
import * as api from './api.js';
import config from '@@utils/config.js';
const emailConfig = config.email();
const myParam = config.get('myParam');
// Your implementation here
export default async function run(config: any) {
try {
// Your main logic
console.log('Running my custom action');
// Send email notification if needed
} catch (error) {
console.error('Error in my action:', error);
}
}# Clone the repository
git clone https://github.com/JohnieXu/public_actions.git
cd public_actions
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Run in development mode
pnpm run dev
# Test your custom action
npx puba run myaction --email-user <USER> --email-pass <PASS> --email-to <TO> --my-param <VALUE>Contributions are welcome! Feel free to submit issues and pull requests.