84 lines
2.5 KiB
Markdown
84 lines
2.5 KiB
Markdown
# insta-note-clock
|
|
|
|
A lightweight Rust CLI daemon that updates your Instagram Note with the current time at a configurable, safe interval.
|
|
|
|
> **Disclaimer:** Instagram has no public API for Notes. This tool interacts with private mobile endpoints, which violates Instagram's Terms of Service. Frequent updates risk rate limits (HTTP 429) or account suspension. Default interval is 120s with exponential backoff. Use at your own risk.
|
|
|
|
---
|
|
|
|
## Quick Start
|
|
|
|
### 1. Build
|
|
```bash
|
|
cargo build --release
|
|
```
|
|
|
|
### 2. Authenticate
|
|
```bash
|
|
# Option A: Direct session cookie import (recommended)
|
|
cargo run -- login --session-id "YOUR_SESSION_ID" --user-id "YOUR_DS_USER_ID"
|
|
|
|
# Option B: Interactive login (supports 2FA or guided cookie entry)
|
|
cargo run -- login
|
|
```
|
|
Session data is saved securely to `session.json` with restricted `0600` permissions.
|
|
|
|
### 3. Run
|
|
```bash
|
|
# Test run without hitting Instagram
|
|
cargo run -- --dry-run once
|
|
|
|
# Update once and exit
|
|
cargo run -- once
|
|
|
|
# Run continuous sync loop
|
|
cargo run -- run
|
|
```
|
|
|
|
---
|
|
|
|
## How to Get Your ds_user_id & sessionid Cookies
|
|
|
|
Using your browser cookies is the safest authentication method because it bypasses Instagram's mobile app bot detection algorithms.
|
|
|
|
1. Open your web browser (Chrome, Firefox, Edge, or Brave).
|
|
2. Go to [instagram.com](https://www.instagram.com) and log in to your account.
|
|
3. Press **F12** (or right-click anywhere and choose **Inspect**) to open Developer Tools.
|
|
4. Go to the storage tab:
|
|
- In **Chrome / Edge / Brave**: Click the **Application** tab at the top.
|
|
- In **Firefox**: Click the **Storage** tab at the top.
|
|
5. In the left sidebar, expand **Cookies** and select `https://www.instagram.com`.
|
|
6. Find these two cookie names in the table:
|
|
- `ds_user_id`: Your numeric user ID (e.g. `6891234567`).
|
|
- `sessionid`: Your private session authentication token.
|
|
7. Copy both values and pass them to the login command:
|
|
```bash
|
|
cargo run -- login --session-id "YOUR_SESSION_ID" --user-id "YOUR_DS_USER_ID"
|
|
```
|
|
|
|
---
|
|
|
|
## Configuration (`config.toml`)
|
|
|
|
```toml
|
|
[instagram]
|
|
session_file = "./session.json"
|
|
timezone = "Asia/Kolkata"
|
|
|
|
[note]
|
|
interval_seconds = 120 # Minimum recommended: 120s
|
|
|
|
# Time display mode: choose "12h" or "24h"
|
|
# "12h" -> 02:30 PM
|
|
# "24h" -> 14:30
|
|
mode = "12h"
|
|
|
|
# Optional custom strftime format (leave empty to use `mode` setting)
|
|
time_format = ""
|
|
|
|
prefix = ""
|
|
suffix = ""
|
|
max_requests_per_hour = 30
|
|
```
|
|
|
|
Environment variables prefixed with `INSTA_` (e.g. `INSTA_NOTE__MODE=24h`) are also supported.
|