ActivityStreams 2.0 vocabulary in machine-readable form, scraped using TypeScript + cheerio
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
bin
data
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

activitystreams2-spec-scraped

Build Status

Scrape data from the ActivityStreams 2.0 specs:

Why?

  • Test libraries that deal with ActivityStreams2 data, e.g. to make sure the library fully models every vocab term. This was the original motivation: to help test gobengo/activitystreams2
  • generate code for libraries in other languages. go-fed/activity did this because the polymorphic nature of ActivityStreams 2.0 / JSON-LD data makes it hard to model in golang's type system
  • render better documentation for ActivityStreams 2.0. Right now the canonical documentation is in a couple huge html files, but it might be easier to maintain HTML docs (ideally with RDFa metadata) if rendered from less messy data like the JSON this library generates.

Usage

node.js/TypeScript

import { scrapeVocabulary, vocabularySpecUrl } from "activitystreams2-spec-scraped"

(async () => {
  let v

  // This will load from a fixture and *will not* make an http request
  v = await scrapeVocabulary()

  // Provide a URL to fetch the html from there, then parse
  v = await scrapeVocabulary(vocabularySpecUrl)

  console.log(v)
})()

Command Line Interface

  • npx activitystreams2-spec-scraped
  • npm install -g activitystreams2-spec-scraped && activitystreams2-spec-scraped
  • Clone repo and npm install && npm start
$ npx activitystreams2-spec-scraped

The output is big!. See ./data/ for a full example.