Small utilities to generate and visualize per-action delay distributions and working-hours schedules used to tune LinkedIn-ish actions (invitations, messages, profile views, emails, etc.).
Why this repo
- Model per-action delays using lognormal distributions so daily limits distribute across working hours.
- Quick iteration: change
scripts/action-rate-limit-config.json→ generate timestamps → produce a plot to inspect spacing.
Prerequisites
- Node.js (v14+ recommended) — generators
- Python 3 (matplotlib, numpy) — plotting
Quick setup
- Install Node deps: npm install
- Install Python deps: pip install -r requirements.txt
Main scripts
- scripts/action-rate-limit-config.json
- Configure
working_hoursand per-actiondelay_config(median_seconds, sigma, min/max intervals) plusdaily_limit/weekly_limit.
- Configure
- scripts/generate-action-rate-limits.js
- Generates
scripts/action-rate-limits-generated.jsonfrom the config. - Run: node scripts/generate-action-rate-limits.js
- Generates
- scripts/plot-action-rate-limits.py
- Creates
scripts/action-rate-limits-plot.png(histograms + timelines). - Run: python scripts/plot-action-rate-limits.py
- Open interactively: python scripts/plot-action-rate-limits.py --show
- Creates
Typical workflow
- Edit
scripts/action-rate-limit-config.jsonto adjust working hours, daily limits, or sigma. - node scripts/generate-action-rate-limits.js
- python scripts/plot-action-rate-limits.py --show
- Inspect
scripts/action-rate-limits-generated.jsonandscripts/action-rate-limits-plot.png
Outputs Outputs
- action-rate-limits-generated.json — per-action timestamps, intervals, and simple stats
- action-rate-limits-plot.png — visualization saved next to the data file
Preview
Notes
- The generator tunes suggested median_seconds so mean interval ≈ working_minutes / daily_limit (see generator comments).
- Intervals in the JSON are in minutes; median_seconds is stored in seconds.
- Keep new features and schemas consistent with the repository's feature-folder style (follow
campaignpattern) and prefer existing DB clients/helpers if present.
Contributing
- Small fixes welcome: update config, add tests, or improve plots. Open a PR.
License
- Use as needed for the project.
