Skip to content

render activitystrea.ms Activities to human-readable phrases

Notifications You must be signed in to change notification settings

gobengo/activity-phraser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

activity-phraser

Activity -> human readable string

var phrase = require('activity-phraser').phrase({
    actor: 'ben',
    verb: 'post',
    object: 'activity-phraser'
});
assert.equal(phrase, 'ben posted activity-phraser');  

more tests

API

  • require('activity-phraser').phrase(activity) - Phrase a whole activity
  • require('activity-phraser').actor(activity.actor) - Phrase just the actor
  • require('activity-phraser').verb(activity.verb) - Phrase just the verb
  • require('activity-phraser').object(activity.object) - Phrase just the object
    • require('activity-phraser').object[type](activity.object) - Phrase a partciular objectType. e.g. 'collection', 'message'

Example

example.js will phrase infinity activity-mocks for you and pipe to stdout.

Joe posted "Used Tesla Roadster"
Martin Smith posted "Why I love Activity Streams"
Martin Smith posted a Photo
urn:example:person:martin posted a link
Bob Doe posted the message "This is a comment post."
site 222 verb "My Collection"
acct:joe@example.org posted a link

About

render activitystrea.ms Activities to human-readable phrases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published