Skip to content

dev.to projects get no live date (unlike youtube/github) — fetch latest article date #22

Description

@ManningWorks

Context

A devto project in projex.config with no manual createdAt / updatedAt ends up fully dateless. normalise falls through to the else branch and fetchDevToUser returns only counts:

// dist/lib/devto.js — return value
return { articleCount, totalViews, totalReactions }   // ← no dates
// dist/lib/normalise.js (else branch covers devto)
finalCreatedAt = inputCreatedAt || null
finalUpdatedAt = inputUpdatedAt || null

Problem

dev.to is the only fetchable source that contributes no date. Contrast:

  • youtube → finalUpdatedAt = youtubeData?.latestVideoPublishedAt || inputUpdatedAt
  • github → finalUpdatedAt = githubData?.updated_at
  • dev.to → config-only

The Dev.to API projex already calls (https://dev.to/api/articles?username=${username}&per_page=1000&state=published) returns each article with published_at and edited_at. Those fields are fetched and discarded.

Proposal

Capture the dates from the articles already being fetched:

  • updatedAt = max(edited_at || published_at) across articles (last activity)
  • optionally createdAt = min(published_at) (first post)

Return them from fetchDevToUser, and in normalise's devto branch use them the same way youtube uses latestVideoPublishedAt. This makes "Last Updated" meaningful for a devto profile — today a dateless devto project sorts unpredictably (see the related sortByDate null-handling issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions