Skip to main content
This guide takes you from a fresh clone to a dispatched press digest in under 15 minutes. You will ingest a WhatsApp .txt export, review the parsed items, and copy a curated digest for a government area panel.

Prerequisites

Before you begin, confirm the following are available:
RequirementVersion / detail
Node.js18 or later
Angular CLI16 (npm install -g @angular/cli@16)
Google Sheets master catalogEditor access to the keyword catalog sheet
WordPress backend credentialsURL and authentication for pruebas01.dev.cordoba.gob.ar
The app reads keyword categories directly from Google Sheets at runtime. If your Google Sheets API key or OAuth token is not configured, category detection will silently produce empty topic[] arrays on every parsed item.

Setup and configuration

1

Clone the repository and install dependencies

git clone https://github.com/hemmerlingd/Media-Monitoring-Smart-Dispatcher.git
cd Media-Monitoring-Smart-Dispatcher
npm install
npm install will pull all Angular 16 dependencies. Expect the install to take 1–2 minutes on first run.
2

Configure the Google Sheets keyword catalog ID

Open src/app/services/shared.service.ts and locate the sheetPalabrasClave field near the top of the service class. Replace the default value with your municipality’s master catalog sheet ID.
src/app/services/shared.service.ts
// Replace the ID below with your own Google Sheets catalog ID
sheetPalabrasClave: string = '1ELi_nCP6XEh4VjB5jTbw8mD7ma2L67qTxPHRwWv6xak';
The sheet ID is the long alphanumeric string in the Google Sheets URL:
https://docs.google.com/spreadsheets/d/<SHEET_ID>/edit
Keep the default ID only if you are connecting to the shared Córdoba Municipality development catalog. For staging or production environments, always point to the correct environment-specific sheet.
3

Configure the WordPress backend URL

In src/app/services/shared.service.ts, three methods interact with the WordPress REST API: leerNoticias, guardarNoticias, and ActualizarNoticias. Each method builds its request URL from the WordPress API base path.Locate all references to the WordPress API base and update them to your environment’s host:
src/app/services/shared.service.ts
// Development / staging base URL — update for your environment
// https://pruebas01.dev.cordoba.gob.ar/wp-json/wp/v2/noticia
The three methods that must point to this base are:
MethodOperation
leerNoticiasGET — fetches previously saved news items from WordPress
guardarNoticiasPOST — persists new parsed items to WordPress
ActualizarNoticiasPUT/PATCH — updates existing items (e.g., after IA summarization)
If you leave the URL pointing to pruebas01.dev.cordoba.gob.ar in a production deploy, all writes will land in the shared testing environment. Verify the correct URL before each environment deployment.
4

Start the development server

ng serve
Angular CLI compiles the app and serves it at http://localhost:4200. Wait for the Compiled successfully message before opening the browser.
The ingestion route is at /controlmedios. Navigate there directly — the root path (/) does not redirect automatically.
5

Upload your first WhatsApp .txt export

  1. Open your browser at http://localhost:4200/controlmedios.
  2. You will land on the ImportarComponent — the ingestion and parse screen.
  3. Click Subir archivo (or the equivalent upload button in your locale build) and select the .txt file exported from WhatsApp.
The file must be a standard WhatsApp chat export in plain-text format. Each message line is treated as a candidate press item. The parser extracts the following fields from each line into a NewsItem object:
NewsItem interface
export interface NewsItem {
  id_: string;       // auto-generated identifier
  sendDate: string;  // parsed from WhatsApp timestamp
  sendTime: string;  // parsed from WhatsApp timestamp
  media: string;     // media outlet name
  program: string;   // program or show name
  text: string;      // raw message body
  resume?: string;   // manual summary (optional)
  iaResume?: string; // AI-generated summary (optional)
  link: string;      // extracted URL if present
  startTime: string; // broadcast start time
  endTime: string;   // broadcast end time
  topic: string[];   // matched keyword categories
  topics: string;    // comma-joined topic string
  destacada?: boolean; // flagged as featured
  copy: boolean;     // included in digest clipboard
}
WhatsApp exports include a header line and system messages (e.g., “Messages and calls are end-to-end encrypted”). The parser skips lines that do not match the expected timestamp pattern, so these are safely ignored.
6

Review parsed items

After the upload completes, the ImportarComponent displays the parsed item list. For each item you should verify:
  • sendDate and sendTime match the original message timestamp.
  • media and program were correctly extracted from the sender or message prefix.
  • topic[] contains at least one category matched against the Google Sheets keyword catalog. Items with an empty topic[] were not matched by any keyword — you can assign topics manually before proceeding.
  • link is populated if the message contained a URL.
Use the inline edit controls to correct any field before saving. Once you are satisfied, click Guardar to persist the items to WordPress via guardarNoticias.
Items flagged with destacada: true will appear at the top of their category panel and are included in the featured section of the digest.
7

Navigate to a category panel

Each government area has its own category panel reachable at:
/controlmedios/panel/:cat
Replace :cat with the URL-encoded category name that corresponds to a keyword group in your Google Sheets catalog. For example, if your catalog defines a group called salud, navigate to:
http://localhost:4200/controlmedios/panel/salud
The PanelComponent loads all NewsItem records whose topic[] array includes the requested category and renders them in dispatch order (featured items first, then chronological).

Ingestion & parse

Upload and parse WhatsApp .txt exports at /controlmedios.

Category panel

Review and dispatch per-area digests at /controlmedios/panel/:cat.

Analytics

Coverage statistics and trend charts at /controlmedios/estadisticas.
8

Copy the digest to clipboard

Inside the category panel, each NewsItem has a Copy toggle (backed by the copy: boolean field on the interface). Toggle on every item you want to include in the outgoing digest.Once your selection is complete:
  1. Click Copiar digest (the clipboard action button at the top or bottom of the panel).
  2. The app assembles all items where copy === true into a formatted digest string and writes it to the system clipboard.
  3. Paste the digest directly into your email client, messaging platform, or CMS to dispatch it to officials.
The digest preserves the order items appear in the panel — featured (destacada: true) items are placed first. Re-order the panel before copying if you need a different sequence.

What’s next

Now that you have completed your first press log cycle, explore the rest of the system:

Keyword configuration

Learn how to add and maintain keyword groups in the Google Sheets master catalog.

Media catalog

Configure media outlet and program abbreviations for accurate name resolution.

Analytics dashboard

Interpret coverage metrics and export reports from the analytics dashboard.

Build docs developers (and LLMs) love