Skip to content

ocasta/ostatus-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ostatus-js: an attempt to implement OStatus in JavaScript:

OStatus consists of the following protocols:

How much is done?

  • There are Mustache XML templates for OStatus protocols inside of the templates folder. See CouchAppSpora for an example of how to render these Mustache templates in CouchDB.
  • RSS/ATOM to ActivityStreams JSON (xmlToActivityStream.js) is useful for converting feeds on the fly

The rest of the OStatus protocols still need to be implemented (pending). If you have feedback or ideas please use the Wiki

An example!

WebFinger requires that your server respond to a certain URL with a certain XML blob called an XRD, so if you curl http://gmail.com/.well-known/host-meta you will receive:


  <?xml version='1.0' encoding='UTF-8'?>
  <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' 
       xmlns:hm='http://host-meta.net/xrd/1.0'>
    <hm:Host xmlns='http://host-meta.net/xrd/1.0'>gmail.com</hm:Host>
    <Link rel='lrdd' 
          template='http://www.google.com/s2/webfinger/?q={uri}'>
      <Title>Resource Descriptor</Title>
    </Link>
  </XRD>

You can use the xrd.xml.mu template and Mustache.js to generate a nice blob of XML just like the above example!

Ideally this will support the XML heavy OStatus as well as JSON alternatives to the individual OStatus XML protocols, such as JRD, the JSON version of XRD.

Why?

CommonJS compatible JavaScript servers like CouchDB would be awesome if they could talk OStatus!

These protocols are being built in order to power another project of mine, couchappspora.

For more info you can read about the federated social web and check out their wiki

License

The MIT License

Copyright © 2010 Max Ogden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

as much of the ostatus stack in commonjs as possible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%