|
1 | | -# Typefully Export Scripts |
| 1 | +# Manual Typefully Exporter |
2 | 2 |
|
3 | | -Utilities for exporting Typefully social-set drafts and turning them into local |
4 | | -analysis/process-doc drafts. |
| 3 | +`export-posts.mjs` is retained as manual, one-shot raw source-export tooling. |
| 4 | +It is not a supported product feature and must not run from application |
| 5 | +runtime, deployment, CI, tests, schedules, or other recurring automation. |
5 | 6 |
|
6 | | -The exporter reads `TYPEFULLY_API_KEY` from `.env` or the environment and does |
7 | | -not print the token. The analyzer reads only its caller-supplied local JSON file |
8 | | -and makes no credential or network request. Keep exports under `.tmp/` because |
9 | | -post archives can contain private Typefully URLs, draft text, and unpublished |
10 | | -drafts. |
| 7 | +Running the exporter requires explicit HUMAN authorization for both provider |
| 8 | +access and the intended export scope. The operator must supply an authorized |
| 9 | +`TYPEFULLY_API_KEY` through the environment or the repository's ignored |
| 10 | +`.env` file. The script does not print the token. |
11 | 11 |
|
12 | | -Generated analysis and process-document drafts are also private operational |
13 | | -data and stay under ignored `.tmp/` paths until separately reviewed for |
14 | | -promotion. The analyzer omits provider private, share, and edit link metadata |
15 | | -from every generated file. If the same exact private link value appears inside |
16 | | -otherwise useful post evidence, it is replaced with a fixed neutral omission |
17 | | -marker. Wrapper punctuation does not suppress omission, while a distinct, |
18 | | -syntactically valid longer public URL remains unchanged. |
| 12 | +Raw exports can contain unpublished text, account context, provider metadata, |
| 13 | +and private Typefully links. Always write them below the repository's ignored |
| 14 | +`.tmp/` directory; they must never be committed, uploaded as public CI |
| 15 | +artifacts, or treated as durable operational knowledge. |
19 | 16 |
|
20 | | -## Export drafts and posts |
| 17 | +After an authorized export, review, analysis, curation, retention, and disposal |
| 18 | +belong to the private operational-knowledge process. Do not add raw exports or |
| 19 | +derived operational documents to this public repository. |
21 | 20 |
|
22 | | -```bash |
23 | | -node scripts/typefully/export-posts.mjs \ |
24 | | - --output .tmp/typefully-export \ |
25 | | - --status all |
26 | | -``` |
27 | | - |
28 | | -By default, the exporter discovers all Typefully social sets available to the |
29 | | -API key. To restrict the export, pass one or more social-set names, usernames, |
30 | | -or ids: |
31 | | - |
32 | | -```bash |
33 | | -node scripts/typefully/export-posts.mjs \ |
34 | | - --output .tmp/typefully-export \ |
35 | | - --status published \ |
36 | | - --social-set DataTalksClub \ |
37 | | - --social-set Al_Grigor |
38 | | -``` |
39 | | - |
40 | | -The export includes: |
41 | | - |
42 | | -- `social-sets.json`: accessible social sets and connected platforms. |
43 | | -- `<social-set>-drafts.json`: raw draft list and detail responses. |
44 | | -- `all-drafts.json`: combined raw export. |
45 | | -- `posts.jsonl`: one normalized row per platform post. |
46 | | -- `posts.csv`: same normalized rows for spreadsheet analysis. |
47 | | - |
48 | | -The normalized rows include both X/Twitter (`platform=x`) and LinkedIn |
49 | | -(`platform=linkedin`) posts when present in Typefully draft details. |
| 21 | +## Authorized manual use |
50 | 22 |
|
51 | | -## Optional X analytics samples |
52 | | - |
53 | | -Typefully analytics currently supports X posts only. LinkedIn analytics is not |
54 | | -available through the Typefully endpoint tested on 2026-06-29. |
| 23 | +The exporter discovers every social set available to the API key unless the |
| 24 | +operator restricts the scope with one or more `--social-set` selectors. Prefer |
| 25 | +an explicit scope and status approved for the one-shot operation: |
55 | 26 |
|
56 | 27 | ```bash |
57 | 28 | node scripts/typefully/export-posts.mjs \ |
58 | 29 | --output .tmp/typefully-export \ |
59 | 30 | --status published \ |
60 | | - --include-x-analytics \ |
61 | | - --analytics-start-year 2022 |
| 31 | + --social-set <approved-name-username-or-id> |
62 | 32 | ``` |
63 | 33 |
|
64 | | -## Analyze an export |
65 | | - |
66 | | -```bash |
67 | | -node scripts/typefully/analyze-posts.mjs \ |
68 | | - --input .tmp/typefully-export/all-drafts.json \ |
69 | | - --output .tmp/typefully-analysis |
70 | | -``` |
| 34 | +The ignored output can include: |
71 | 35 |
|
72 | | -This creates: |
| 36 | +- `social-sets.json`, containing accessible social sets and platforms; |
| 37 | +- `<social-set>-drafts.json`, containing raw draft records and details; |
| 38 | +- `all-drafts.json`, containing the combined raw export; |
| 39 | +- `posts.jsonl` and `posts.csv`, containing normalized platform-post rows; and |
| 40 | +- `x-analytics.json` when the separately authorized |
| 41 | + `--include-x-analytics` option is used. |
73 | 42 |
|
74 | | -- `analysis.md` |
75 | | -- `process-doc-drafts/*.md` |
| 43 | +Use `node scripts/typefully/export-posts.mjs --help` to inspect the available |
| 44 | +manual options before an authorized run. A past export does not authorize a |
| 45 | +future one; each run requires a new HUMAN/provider authorization and an |
| 46 | +explicit private-data disposition. |
0 commit comments