byline-finder

How Byline Finder works, and which problems it fixes

This guide explains, in plain terms, what goes wrong when students save sources to Zotero, and exactly how Byline Finder fixes each problem. For installation see the README; for measured results see the test report.

The problem

A student clicks the Zotero Connector on a webpage. Zotero saves the title and URL, but often leaves Author and Date blank:

PDFs have the same problem: a report clearly names its author and publication date on the cover, but Zotero keeps it as a bare file with no citation information.

A blank or wrong author or date means a wrong citation. Byline Finder fills these fields in automatically, with evidence, and never overwrites what is already there.

The flow at a glance

flowchart TD
    A[Item added to Zotero<br/>Connector, drag-in, sync] --> B{Webpage or PDF?}
    B -->|Webpage| C[Wait ~8 s for the snapshot]
    C --> D[1. Read saved snapshot]
    D -->|not enough| E[2. Read live public page]
    E -->|not enough| F[3. Wayback Machine:<br/>archived copies of exact URL]
    D --> G[Pick best-supported author and date]
    E --> G
    F --> G
    B -->|PDF| H{Zotero recognized it?}
    H -->|yes, parent created| I[Fill parent's empty fields from PDF]
    H -->|no| J[Read PDF: XMP, cover, imprint pages<br/>OCR if scanned]
    J --> K[Create ONE typed parent item]
    G --> L[Write only fields that are still empty]
    I --> L
    K --> L
    L --> M[Record source + evidence<br/>shown in item pane, undoable]

Everything runs inside Zotero desktop. The user does nothing beyond the ordinary save.

Step by step

1. Starting automatically

The plugin listens for Zotero’s “item added” events (the same events a Connector save, a drag-and-drop or a sync produces).

To avoid surprises, only items added in the last 14 days are processed automatically, and large imports (more than 50 items at once) are skipped. Older items can be processed on request (right-click → Byline Finder → Find Missing Author and Date).

2. Finding the author of a webpage

The plugin collects every possible attribution and gives each a confidence score. The strongest one wins:

Evidence Example Strength
Scholarly citation_author tags journal article pages highest
Structured data (JSON-LD) naming a person "author": {"@type": "Person", "name": "Eleanor Lawrie"} (BBC) very high
Explicit statement “This page was written by Macmillan Cancer Support”, “Analysis by Bazian” very high
Visible byline “By Aïsha Rahman and Tom Smith-Jones” high
Structured data naming an organisation, or GOV.UK “From:” “From: Department for Education” medium
Meta tags (author, Dublin Core) <meta name="author" content="Madeleine Breen"> medium
Publishing organisation, when no individual is credited NHS, University of Cambridge fallback

How it avoids the wrong names

If no defensible author exists, Author is left empty and the item pane shows why (for example “only reviewer credited: Dr Peter Reviewer”).

3. Finding the original publication date of a webpage

The plugin reads dates from structured data, meta tags, <time> elements and visible labels, and classifies each one by its label:

Label next to the date Treated as
“First published”, “Originally published” original publication (strongest)
“Published”, “Posted”, “Issued”, JSON-LD datePublished publication
“Last updated”, “Modified”, “Revised” not publication
“Page last reviewed”, “Next review due” not publication
“Effective from”, “Comes into force” not publication
“©”, “Copyright”, “Accessed”, “Retrieved” not publication

Rules that prevent the classic mistakes:

4. Using the Internet Archive when the page lost its details

If the snapshot and live page don’t give a well-supported author or date, the plugin asks the Wayback Machine (its documented CDX API) for archived copies of the exact URL, and reads a few captures spread over time, oldest first.

Example (tested): a 2017 NHS news page that now returns Gone gets Author: Bazian (“Analysis by Bazian”) and Date: 2017-03-03 from its 2017 archived copy.

Publish Date Finder: it has no documented API for automatic use, so its methods (meta tags, JSON-LD, <time>, text patterns) are built into the plugin. Right-click → Byline Finder → Open Publish Date Finder opens the site with the URL on your clipboard if you want a second opinion.

5. Reading PDFs

  1. Zotero goes first. If Zotero’s built-in recognizer creates a parent item, Byline Finder only fills that parent’s empty fields.
  2. Otherwise the plugin reads the PDF itself using Zotero’s own PDF engine (first 5 pages, with font sizes), plus the file’s XMP metadata and document properties.
  3. Scanned PDFs (no text layer) are read with local OCR: Windows’ built-in OCR on Windows; pdftoppm + tesseract on macOS/Linux if installed.
  4. It works out the title (largest text on page 1), authors (“Prepared by …”, the name line under the title, verified XMP), date (“Published November 2016”, a stand-alone date on the cover), issuing organisation (“About Public Health England”, “Published by …”, “© …”), report number, ISBN (checksum verified), edition, journal/volume/issue/pages and language.
  5. It picks the item type: thesis, conference paper, journal article, book, report or document.
  6. It creates one parent, puts the PDF under it, and keeps the PDF’s collections, notes and annotations. The file itself is not renamed or changed.

Traps it avoids (each one has a test):

Trap What the plugin does
A DOI in the bibliography identifies a cited paper Only a DOI on the title page or in XMP is used, and only if Crossref’s title for it matches the document’s title
The PDF’s Author property holds a computer username or the person who typed the file (“hpowner”, “Karen Watts”) Used only if that name actually appears in the document text
File creation/modification dates are scanning or export dates Never used as publication dates
A report cover shows a meeting date (“Board meeting 14 September 2023”) Dates next to meeting, agenda, board or committee wording are rejected
Encrypted or unreadable PDFs Skipped with a visible reason; nothing is created

Example (tested): GOV.UK’s From Plate to Guide report PDF (no DOI) gets one Report parent: author Public Health England, date 2016-11, report number 2016451, original file still attached.

6. Writing safely

7. Seeing where a value came from, and undoing it

Mobile, tablet and web saves

Processing happens only in Zotero desktop with the plugin installed. An item saved on iPhone, iPad, Android or zotero.org syncs to the desktop, gets enriched there, and the corrected fields sync back; you see them on mobile after its next sync. If the desktop was closed, this happens the next time it opens and syncs. A PDF that hasn’t downloaded yet is fetched (when file sync is on) or processed when it arrives.

Known limits

Code map

File What it does
addon/bootstrap.js Zotero plugin start/stop; loads the scripts and the language strings
addon/content/engine.js The Zotero side: listens for new items, queue, sweeps, writing, undo, item-pane section, menus
addon/content/extract.js Reads author, date, site name and language from a webpage
addon/content/wayback.js Internet Archive lookup and checks
addon/content/pdfmeta.js Reads bibliographic details from PDF text and XMP; checks DOIs against Crossref
addon/content/dates.js Parses dates and personal/organisation names
addon/content/ocr.js, ocr-windows.ps1 Local OCR for scanned PDFs
test/ Automated tests and the real-Zotero end-to-end tests
bench/ Benchmark against stock Zotero and MyBib