npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openstories-types

v0.0.10

Published

Open Stories is a syndication format for distributing stories to friends and families.

Downloads

86

Readme

Open Stories

Open Stories is a syndication format for distributing stories to friends and families.

Stories are small pieces of media – such as images and video clips – with a 9:16 aspect ratio.

An OpenStories feed is essentially a JSON Feed Version 1.1 with extensions.

You can validate a OpenStoriesFeed with its TypeScript definitions in openstories-types.

Clients

  • <open-stories>: A custom element that will display a single OpenStoriesFeed's content.

Example

A minimal OpenStoriesFeed may look like the following; note, specifically the required _open_stories object for each item.

{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Valid feed",
  "_open_stories": {
    "version": "0.0.9"
  },
  "items": [
    {
      "id": "a1",
      "content_text": "Text",
      "authors": [{"name": "muan", "url": "https://muan.co"}],
      "_open_stories": {
        "mime_type": "image/jpg",
        "url": "https://example.com/a1.jpg",
        "alt": "Sky"
      }
    },
    {
      "id": "a2",
      "content_text": "Text 2",
      "authors": [{"name": "muan", "url": "https://muan.co"}],
      "_open_stories": {
        "mime_type": "image/jpg",
        "url": "https://example.com/a2.jpg",
        "alt": "Sky"
      }
    }
  ]
}

An Open Stories feed

Top-level

The top level object of the feed matches that of a JSON Feed with the following additions:

  • _open_stories (required, Open Stories Metadata): The Open Stories Metadata of this feed.
  • items: (required, an array of Open Stories Items): The items of the feed.
  • feed_url: (required, string): Unlike in JSON Feed, feed_url is a required field in Open Stories feeds.

Open Stories Metadata

Metadata that identifies an Open Stories feed

  • preview (optional, Preview): Data that helps clients display a preview of the feed while loading its items.
  • version: (required, String): The version of the Open Stories used for this feed. Currently, only 0.0.9 is supported.

Items

Items represent stories in the feed. Items in an Open Stories feed match Items of a JSON Feed with the following additions:

Addtionally, authoring software of Open Stories is encouraged to populate the content_html field of the Item with an approximation of the stories contents, e.g. an <img> point at the same url as the Item's _open_stories.url, with an alt attribute matching _open_stories.alt.

<img src='{{ item._open_stories.url }}' alt='{{ item._open_stories.alt }}'>
{{ item._open_stories.caption }}

Image Story

Common fields between Image Stories and Video Stories:

  • url: (required, String): The URL of the image. Expected to be in a 9:16 aspect ratio.
  • date_expired (optional, String): The date at which the story did or will expire. Clients are encouraged not to display stories after this date.
  • preview (optional, Preview): Data that helps the client display a preview while this image is loading.
  • reactions (optional, Reactions): Data that describes how clients can react to this image.
  • content_warning (optional, String): If present, clients should display this warning before showing the story to the user.
  • duration_in_seconds (optional, Number): How long the story should be displayed for. Clients are free to adjust this number.
  • alt (required, String): The alt text of the image.
  • caption (optional, String): The caption of the image.

Fields unique to Image Story:

  • mime_type (required, String beginning with image/${string}): the MIME type of the image.

Video Story

Common fields between Image Stories and Video Stories:

  • url: (required, String): The URL of the video. Expected to be in a 9:16 aspect ratio.
  • date_expired (optional, String): The date at which the story did or will expire. Clients are encouraged not to display stories after this date.
  • preview (optional, Preview): Data that helps the client display a preview while this video is loading.
  • reactions (optional, Reactions): Data that describes how clients can react to this video.
  • content_warning (optional, String): If present, clients should display this warning before showing the story to the user.
  • duration_in_seconds (optional, Number): How long the story should be displayed for. Clients are free to adjust this number.
  • title (required, String): A description of the video.

Fields unique to Video Story:

  • mime_type (required, String beginning with video/): the MIME type of the video.
  • tracks (optional, an array of Tracks): The tracks for the video.

Tracks

  • url (required, String): The URL of a WEBVTT file.
  • lang (optional, String): A BCP47 language subtag for the track.
  • kind (optional, String): 'captions' (default), 'subtitles', 'chapters'.
  • label (optional, String): A user readable label for the track.

Authors

Authors represent people that created the stories in the feed. Authors in an Open Stories feed match Authors of a JSON Feed with the following additions:

  • name (required, String): Unlike in JSON Feed, name is a required field in Open Stories feeds.
  • url (required, String): Unlike in JSON Feed, url is a required field in Open Stories. url is expected to uniquely identify the author across feeds and items.

Preview

A Preview is a light-weight representation that allows clients to construct a more pleasant preview image while the actual story is loading.

  • blurhash (optional, String): A blurhash representation of this item, at a 9:16 aspect ratio.
  • color (optional, String): A solid color that can be used as a placeholder to this story.

Reactions

Reactions allow a client to communicate back to the authors of a story.

  • open_heart_urls (optional, String): A Open Heart URL.