File size: 3,919 Bytes
3ff9525
 
 
 
 
 
 
 
 
cb6c7d2
3ff9525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cb6c7d2
3ff9525
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Writing.com Archive - TSV Data Format

This document provides a reference for the column structure and data formats used in the shared Writing.com Interactive Stories

## File Specification
- **Format:** Tab-Separated Values (TSV)
- **Encoding:** UTF-8 (with BOM)
- **Headers:** Included as the first line

---

## Column Definitions

| Index | Column Name | Description |
| :--- | :--- | :--- |
| 1 | `STORY_TITLE` | The overall title of the story/book. |
| 2 | `CHAPTER_TITLE` | The specific title of the chapter or node. |
| 3 | `AUTHOR_DISPLAY` | The display name of the author of this entry. |
| 4 | `AUTHOR_HANDLE` | The raw username/handle of the author. |
| 5 | `CONTENT` | The body text of the chapter. (See [Content Formatting](#content-formatting)). |
| 6 | `CHOICES` | Delimited list of branching options. (See [Choices Formatting](#choices-formatting)). |
| 7 | `DATE_POSTED` | The date the entry was originally posted (usually `MM-DD-YYYY`). |
| 8 | `MAP_ID` | **Crucial unique identifier.** (See [Understanding MAP_ID](#understanding-map_id)). |
| 9 | `STORY_URL` | The original Writing.com URL for the story. |
| 10 | `COVER_IMAGE` | **(See Warning below)** URL to the story's cover image. |
| 11 | `SYNOPSIS` | **(See Warning below)** The summary/description of the story. |
| 12 | `RELATED_URL` | Secondary or related external links. |

> [!WARNING]
> **Metadata Consistency:** To maintain data integrity and reduce redundancy, the `SYNOPSIS` and `COVER_IMAGE` columns are generally only populated in rows where the `MAP_ID` indicates an **`-Intro`** chapter. Since these values are the same for every chapter in a story, you should look to the Intro row as the primary source for this information.

---

## Understanding `MAP_ID`

The `MAP_ID` is the most important field for organizing, linking, and deduplicating the data. It follows a specific hierarchical format:

**Format:** `[STORY_ID]-[CHAPTER_ID]-[UNIX_TIMESTAMP]`

*   **`STORY_ID`**: A unique numeric ID for the entire story (e.g., `1234567`).
*   **`CHAPTER_ID`**: The identifier for the specific chapter node. 
    *   **The Intro**: The starting node of any story is marked with `-Intro` (e.g., `1234567-Intro`). 
        *   *Note:* You may find multiple Intro entries with different timestamps. This is intentional and allows the archive to preserve different variations of a story's introduction as they evolved over time.
    *   **Branches**: Subsequent chapters have numeric or alphanumeric IDs (e.g., `1234567-1411`).
*   **`UNIX_TIMESTAMP`**: A versioning suffix. Because the archive may contain multiple "snapshots" of the same chapter over time, this timestamp tells you which version is the most recent.

**Deduplication Strategy:** When processing this file, if you encounter multiple rows with the same `STORY_ID` and `CHAPTER_ID`, you must prioritize the one with the **highest timestamp**.

---

## Technical Details

### Content Formatting
The `CONTENT` column may contain:
- Raw plain text.
- HTML snippets (e.g., `<br>`, `<div>`).
- JSON-encoded HTML objects, e.g., `{"html": "Body text here..."}`. This format is used to preserve complex formatting or handle special characters.

### Choices Formatting
The `CHOICES` column contains the options available to a reader at the end of a chapter. Multiple choices are separated by a double-pipe delimiter: `||||`.
*Example:* `Go through the door||||Wait in the hall||||Run away`

---

## Processing Recommendations
1.  **Deduplication First**: Filter the dataset by `STORY_ID-CHAPTER_ID` (the first two parts of the MAP_ID) and keep only the entry with the largest timestamp.
2.  **Global Metadata**: Link story-level information (`SYNOPSIS`, `COVER_IMAGE`) from the `-Intro` chapter to all other chapters belonging to that same `STORY_ID`.
3.  **JSON Handling**: Be prepared to parse JSON in the `CONTENT` column to extract the underlying HTML/text.

---

license: mit