@nitrimandylis/leftonread 0.0.0-stage → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +116 -2
- package/dist/lor.js +2185 -0
- package/man/lor.1 +126 -0
- package/package.json +47 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nitrimandylis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
-
|
|
1
|
+
```
|
|
2
|
+
██╗ ███████╗███████╗████████╗ ██████╗ ███╗ ██╗██████╗ ███████╗ █████╗ ██████╗
|
|
3
|
+
██║ ██╔════╝██╔════╝╚══██╔══╝██╔═══██╗████╗ ██║██╔══██╗██╔════╝██╔══██╗██╔══██╗
|
|
4
|
+
██║ █████╗ █████╗ ██║ ██║ ██║██╔██╗ ██║██████╔╝█████╗ ███████║██║ ██║
|
|
5
|
+
██║ ██╔══╝ ██╔══╝ ██║ ██║ ██║██║╚██╗██║██╔══██╗██╔══╝ ██╔══██║██║ ██║
|
|
6
|
+
███████╗███████╗██║ ██║ ╚██████╔╝██║ ╚████║██║ ██║███████╗██║ ██║██████╔╝
|
|
7
|
+
╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝
|
|
8
|
+
```
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
<div align="center">
|
|
11
|
+
|
|
12
|
+
### `YOUR INSTAGRAM EXPORT // TURNED INTO PAGES YOU ACTUALLY OPEN`
|
|
13
|
+
|
|
14
|
+
*a per-chat Wrapped, a ranked archive of every reel you traded, a printable keepsake of one chat, built from the JSON Meta hands you*
|
|
15
|
+
|
|
16
|
+
    
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 💬 What is this
|
|
25
|
+
|
|
26
|
+
Instagram lets you download everything you ever sent, as a zip of JSON files nobody opens. `lor` reads that zip into a local SQLite database and writes HTML pages: a Wrapped for each chat, with story slides you can save as PNGs; a best-of archive of every reel that went back and forth in your DMs, ranked by how it landed; a keepsake booklet of one chat; a taste map of the creators you and each friend send; and a backlog of the reels and saved posts worth acting on.
|
|
27
|
+
|
|
28
|
+
Nothing leaves your machine. The export is parsed locally, the pages are single files with the data inlined, and the only network request is Instagram's own embed script when you scroll the reels or backlog page. Two opt-ins reach further: `backlog` reads saved-post captions with `yt-dlp`, and `backlog --llm` sends public reel captions (never your messages) to Claude through your own `claude -p` login. It also fixes Meta's encoding on the way in, so "γεια" stops arriving as "γεια".
|
|
29
|
+
|
|
30
|
+
Most of what you sent turns out to be memes, which the ranking treats as the primary source it is.
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
nick@leftonread:~$ lor ingest instagram-*.zip
|
|
34
|
+
Read 3 files: 15,715 new messages.
|
|
35
|
+
3 chats, 15,715 messages, 1,355 reels, 0 saved posts. Owner: Alex Rivera.
|
|
36
|
+
[i] numbers from the synthetic fixture in tapes/. yours will be worse.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 📊 The pages
|
|
40
|
+
|
|
41
|
+
| | page | what it actually shows |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| 01 | **who texts first** | share of conversations each of you opens. a conversation starts after 6 hours of silence |
|
|
44
|
+
| 02 | **reply time** | median wait between the first message of a conversation and the other person's first answer. quick back-and-forth inside a conversation does not count |
|
|
45
|
+
| 03 | **peak hour** | the hour of the day the chat is busiest, with a 24-bar histogram in your local time |
|
|
46
|
+
| 04 | **longest streak** | most consecutive days with at least one message, with the dates |
|
|
47
|
+
| 05 | **words only you two use** | words said 5+ times in this chat and at most twice anywhere else in your export |
|
|
48
|
+
| 06 | **reel balance** | reels you sent vs reels they sent (the ratio is rarely flattering) |
|
|
49
|
+
| 07 | **reactions** | how many each of you gave and the emoji you lean on |
|
|
50
|
+
| 08 | **best reels** | every shared reel scored: 😂🤣💀😭 reactions count 3, ❤️😍🔥 count 2, a laugh reply within 30 min counts 2, each extra chat it was forwarded to counts 1.5 |
|
|
51
|
+
| 09 | **search** | one box over caption, creator, chat, person and month (`2026-03`), embeds load as you scroll |
|
|
52
|
+
| 10 | **keepsake** | one chat's firsts (first message, reel, photo, voice note, call, "miss you"), the 12 moments that got the most reactions and laughs, where each inside joke started, and a photo a month. Keep or drop each, reorder chapters, caption them, then print to an A5 PDF |
|
|
53
|
+
| 11 | **taste map** | each person's top creators, how many of a friend's creators you send too, and who got whom into a creator (they sent it to you before you ever sent it, and you went on to send it) |
|
|
54
|
+
| 12 | **backlog** | reels and saved posts sorted into to cook, to go, to do, to buy, to train, to learn. Keyword rules in English and Greek first, memes skipped; `--llm` lets Claude sort the rest through `claude -p`, 100 captions a call, cached so it runs once |
|
|
55
|
+
|
|
56
|
+
Each Wrapped slide is a 1080×1920 canvas with a Save PNG button, drawn as a poster: one number as big as the slide allows, one sentence, one plain shape, in flat colour fields. Where two of you are compared, the slide is cut in two and the bigger number gets more of it. A group chat gets its own set: who talks most, who starts, peak hour, streak, the group's own words, and who sends the most reels and reactions, six people to a slide. `--anon` swaps every other name for "them" ("person 1", "person 2" in a group) before you post one.
|
|
57
|
+
|
|
58
|
+
## 🚀 Run it
|
|
59
|
+
|
|
60
|
+
Needs Node 24+ and `unzip`. Get the export from Instagram: Accounts Center > Your information and permissions > Download your information, tick Messages (and Saved, for the backlog), format **JSON**. Big exports arrive as several zips; pass them all at once.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @nitrimandylis/leftonread ingest ~/Downloads/instagram-*.zip # run once, nothing installed
|
|
64
|
+
npm i -g @nitrimandylis/leftonread # or: bun add -g @nitrimandylis/leftonread
|
|
65
|
+
lor chats
|
|
66
|
+
lor wrapped --chat maria
|
|
67
|
+
lor reels
|
|
68
|
+
lor keepsake --chat maria
|
|
69
|
+
lor taste
|
|
70
|
+
lor backlog # add --llm to let Claude Code (claude -p) sort what the rules miss
|
|
71
|
+
man lor
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Pages land in `~/.config/leftonread/` and open in your browser. Every command takes `--json` and prints one JSON value instead, for scripts and agents. Rerunning `ingest` on a newer export only adds what is new.
|
|
75
|
+
|
|
76
|
+
### Agent skill
|
|
77
|
+
|
|
78
|
+
`leftonread-cli/SKILL.md` tells a coding agent how to drive `lor`. Every command runs unattended with `--json`; the skill covers the order (ingest first), how `--chat` matches (a first name, or a group's title), how the owner is detected, and what is not built yet. Copy the folder into your agent's skills directory.
|
|
79
|
+
|
|
80
|
+
## 🔩 Under the hood
|
|
81
|
+
|
|
82
|
+
```mermaid
|
|
83
|
+
flowchart LR
|
|
84
|
+
zip[export zips] -- unzip, only message_N.json --> ingest
|
|
85
|
+
ingest -- fix mojibake, dedupe --> db[(node:sqlite)]
|
|
86
|
+
db --> wrapped[wrapped.html]
|
|
87
|
+
db --> reels[reels.html]
|
|
88
|
+
db --> keepsake[keepsake.html]
|
|
89
|
+
db --> taste[taste.html]
|
|
90
|
+
db --> backlog[backlog.html]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| file | job |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `leftonread.ts` | the CLI: strict flag parsing, dispatch, opens the browser |
|
|
96
|
+
| `ingest.ts` | unzips only the message files, fixes Meta's latin-1 mojibake, classifies messages, dedupes into SQLite, works out whose export it is |
|
|
97
|
+
| `wrapped.ts` | per-chat stats and the slide page, drawn on `<canvas>` so Save PNG is one `toBlob` |
|
|
98
|
+
| `reels.ts` | groups shares by reel, credits laugh replies, scores, writes the searchable page |
|
|
99
|
+
| `keepsake.ts` | finds firsts, landed moments, inside jokes and monthly photos; pulls only the photos it needs out of the export; the edit-then-print page |
|
|
100
|
+
| `taste.ts` | creators per person, overlap per friend, introductions |
|
|
101
|
+
| `backlog.ts` | keyword rules, `yt-dlp` for saved-post captions, the optional Claude pass, the tabbed page |
|
|
102
|
+
| `page.ts` | the HTML shell and the inlined JSON (with `<` escaped, because captions contain everything) |
|
|
103
|
+
| `tapes/` | the synthetic export and the script that renders the hero image above |
|
|
104
|
+
|
|
105
|
+
**Stack:** TypeScript · Node 24 (`node:sqlite`) · Bun for build and tests · zero runtime dependencies
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
<div align="center">
|
|
110
|
+
|
|
111
|
+
**[Nick Trimandylis](https://github.com/nitrimandylis)**
|
|
112
|
+
|
|
113
|
+
`SEEN 9,946 REELS. REPLIED TO FEWER`
|
|
114
|
+
|
|
115
|
+
MIT licensed.
|
|
116
|
+
|
|
117
|
+
</div>
|