node-red-contrib-ushahidi 1.0.1

A node for Node-Red that can be used to POST things to an Ushahidi deployment

npm install node-red-contrib-ushahidi

Introduction

A node that can be used for posting information to Ushahidi. It does not support any other ways to interact with Ushahidi as of right now. There might be more nodes added in the future (getting posts, updating data, deleting posts).

Installation

Use npm to install locally:

npm install node-red-contrib-ushahidi

Or if you're running a global Node-Red installation:

npm install -g node-red-contrib-ushahidi

Usage

Drag the node into the workspace and then set it up by entering the appropriate information in the settings box that shows up when double clicking the node.

Inputs

Required

  • msg.title will be the title of the post
  • msg.payload will be the description of the post
  • msg.loc is a JavaScript object that includes the location of the post. The latitude should be set in a property lat and the longitude in lon. E.g: msg.loc = {lat: 13, lon: 37}

Optional

  • msg.author will be the name of the author of the post. Cannot be used when logged on to a non-admin account.
  • msg.email will be the author's email. Cannot be used when logged on to a non-admin account.
  • msg.formId will be the id of the form on the Ushahidi deployment. Defaults to 1.

Outputs

  • msg.payload is the payload you get back from the server
  • msg.statusCode is the HTTP status code returned by the server

Other notes

  • In order for your posts to show up directly on the map you have to log on using an admin account (and post them as Published not Draft). This is how Ushahidi works and nothing we can do anything about. You can also post using a regular account or without an account (as Draft) but these won't show up on the map until the admin approves them.
  • Posting an email address that is not valid will result in an error from Ushahidi. To solve this, simply send no email address at all in your msg object.

Node Info

Version: 1.0.1
Updated 9 years, 1 month ago
License: ISC
Rating: not yet rated

Actions

Rate:

Downloads

1 in the last week

Nodes

  • ushahidi-post

Keywords

  • node-red
  • nodejs
  • nodered
  • ushahidi

Maintainers