Socket
Book a DemoInstallSign in
Socket

cta-scr-api-client-durban-2015

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cta-scr-api-client-durban-2015

The API client module for the CTA Shared Content Repository (Durban Hackathon 2015 edition)

1.0.2
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cta-scr-api-client (Durban hackathon 2015 edition)

introduction

The API client module for the CTA Shared Content Repository

This is a special version of the API client that was made and published specifically for the AgriHack challenge in Durban

http://durban-agrihack.ict4ag.org/index.php/about-2/

installation

$ npm install cta-scr-api-client-durban-2015 --save

usage

Generate a project and then run grunt to build/update the distribution sources. You can also use grunt watch to continuously update when file changes are detected.

enrichment event subscribtion

There is a pubsub-js based setup you can subscribe to like so:

subscription = api.events.subscribe( "enrichment", ( msg, data ) ->
    console.log( "[SOCKET] enrichment", msg, data or "" )
)

or for only articles:

subscription = api.events.subscribe( "enrichment.article", ( msg, data ) ->
    console.log( "[SOCKET] enrichment", msg, data or "" )
)

or for a specific article:

subscription = api.events.subscribe( "enrichment.article.<articleId>", ( msg, data ) ->
    console.log( "[SOCKET] enrichment", msg, data or "" )
)

Don't forget to unsubscribe when you no longer want to listen to the messages:

api.events.unsubscribe( subscription )

The msg will contain the full message name. This will always be in the format:

enrichment.<type>.<id>

The data will be an object that looks like this:

{
    type:       "article",
    id:         articleId,
    success:    true,
    msg:        "done"

}

FAQs

Package last updated on 25 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.