Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gobengo/activity-phraser
render activitystrea.ms Activities to human-readable phrases
https://github.com/gobengo/activity-phraser
Last synced: 25 days ago
JSON representation
render activitystrea.ms Activities to human-readable phrases
- Host: GitHub
- URL: https://github.com/gobengo/activity-phraser
- Owner: gobengo
- Created: 2014-07-02T13:17:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-02T14:19:32.000Z (over 10 years ago)
- Last Synced: 2024-10-03T15:33:16.271Z (about 1 month ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# activity-phraser
[Activity](http://activitystrea.ms/) -> human readable string
```javascript
var phrase = require('activity-phraser').phrase({
actor: 'ben',
verb: 'post',
object: 'activity-phraser'
});
assert.equal(phrase, 'ben posted activity-phraser');
```[more tests](./test/index.js)
## 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](./example.js) will phrase infinity [activity-mocks](https://github.com/gobengo/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:[email protected] posted a link
```