GithubHelp home page GithubHelp logo

node-red-web-nodes's Introduction

node-red-web-nodes

A collection of node-red nodes aimed at web services

Installation

This repository acts as an overall store for these nodes - and is not intended as a way to install them - unless you really do want some development.

These nodes are separated into individual npms and available to install from npm.

To install - either use the manage palette option in the editor, or change to your Node-RED user directory - this is usually ~/.node-red

    cd ~/.node-red
    npm install node-red-node-{nodename}

Nodes

The install name is node-red-node-(the name in braces). For example

    cd ~/.node-red
    npm install node-red-node-weather-underground
  • Amazon S3 (aws)
  • Box (box)
  • Delicious (delicious)
  • Dropbox (dropbox)
  • FitBit (fitbit)
  • Flickr (flicker)
  • Forecast.io (forecastio)
  • FourSquare/Swarm (foursquare)
  • Google Calendar (google)
  • Google Directions (google)
  • Google Geocoding (google)
  • Google Places (google)
  • Google Plus (google)
  • Instagram (instagram)
  • Jawbone (jawboneup)
  • OpenWeatherMap (openweathermap)
  • Pinboard (pinboard)
  • Strava (strava)
  • Transport for London (tfl)
  • Weather Underground (weather-underground)

Running Tests

To run tests on all of the nodes you will need the node-red runtime:

 npm i node-red-web-nodes
 npm test

Contributing / Fixes

Now that we support npm installaton of nodes we recommend people create and post their own via npm. Please read the packaging guide notes.

For simple typos and single line fixes please just raise an issue pointing out our mistakes. If you need to raise a pull request please read our contribution guidelines before doing so.

Copyright and license

Copyright JS Foundation and other contributors, http://js.foundation under the Apache 2.0 license.

node-red-web-nodes's People

Contributors

aylesm avatar bartbutenaers avatar belialboy avatar cellerich avatar cinhcet avatar clickworkorange avatar codymwalker avatar dceejay avatar dependabot[bot] avatar firewizard52 avatar hbeeken avatar heikokue avatar hindessm avatar jonashermansen avatar juggledad avatar kazuhitoyokoi avatar knolleary avatar kuehnelbs avatar lolhens avatar michal-konopinski avatar mikakaraila avatar mjunghanns avatar neonox31 avatar papettotv avatar paul-reed avatar quazzie avatar raminios avatar sakazuki avatar sircuri avatar zobalogh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-web-nodes's Issues

Google Calendar Query node - returning deleted events.

By design it would appear that Google's Calendar API returns deleted items (why? It appears a crazy choice to me!).
This means the Query node which returns the next entry can return a deleted event.

Whilst the status can be seen within the raw data object, given some of the data is exposed within the payload object should the "status" of the event be included?

Or should the node be able to return the first non-deleted event?

Dropbox Node

Input

  • Watch for changes to dropbox:
    • node options
      • filepattern - minimatch/glob pattern to filter files on (optional, default include all files)
    • output msg properties
      • payload - the full path of the changed file
      • file - the basename of the changed file
      • event - the type of event either add or delete
      • data - the raw change object from the api call response

Query

  • Retrieve a file from dropbox:
  • Get dropbox file contents
    • node options
      • filename - full path of file to retrieve
      • localfilename - local file to write content to (optional - defaults to storing content in payload)
    • msg options
      • filename - full path of file to retrieve
      • localfilename - local file to write content to
    • output msg properties
      • payload - the content of the file (deleted if there is an error)
      • filename - the full path of the file retrieved
      • error - an error object (deleted if the request was successful)

Outputs

  • Write to a file (create/replace)
    • node options
      • filename - filename of the remote dropbox file
      • localFilename - local filename containing the content to be uploaded to dropbox
    • msg options
      • filename - filename of the remote dropbox file
      • localFilename - local filename containing the content to be uploaded to dropbox
      • payload - the content to be uploaded (localFilename takes priority)

Authentication

Users must register their own app at https://www.dropbox.com/developers and paste the required tokens into the node.

Jawbone UP node to query for workout updates

Query Node

The node will query the Jawbone UP API to retrieve the latest (latest one or latest 10) workouts that have been completed since the provided workout start time. If no start time has been specified then the default is from the time the query is run.

The user can specify how they wish to return the results, either as a single or as multiple messages.

jawboneup-ui

Authentication

OAuth2.0 authentication is required in order to use this node.

Flickr Node

Input Node

  • A new photo is added to a user's stream
    • tbd

Output Node

  • Upload a photo to a user's stream
    • node options

      • tags - space separated list of tags to apply to all photos
      • privacy - p:public, pr:private, fr:friends, fa:family, fafr:friends and family
    • message option

      • payload - a Buffer containing the image (required)
      • title - the title for the photo (optional)
      • description - the long description for the photo (optional)
      • tags - tags to be applied (in addition to any set in the node). Either a string containing space-separated tags, or an array of individual tags.
    • example flow

      [gpio: sensor triggered] - [exec: triggers webcam] - [file: reads image] - [function: sets title] - [flickr: uploads]

Query/Function Node

  • none

Authentication

Bug: "swarm-credentials" should be renamed to "foursquare-credentials"

Although the Swarm node is called "Swarm", the credentials part of it should be "Foursquare". This has become apparent when looking at flows to do with using Foursquare to find "venues near me". The venues side is definitely Foursquare and the check-ins side is definitely Swarm, however, they share the same credentials and should only be entered once by the user. The Foursquare API docs say:

"For now, our OAuth process remains exactly the same, and developers and apps will be able to see a connected user’s information across both Foursquare and Swarm (although we have two apps, there is still only one User model for Foursquare users)."

Since the main "brand" is Foursquare, the credentials should be named foursquare-credentials.

Thoughts?

Bug: TFL Underground node disabling all OK buttons

If you open the TFL underground node, leave the terms and conditions box unticked and hit cancel, all active and new node OK buttons become disabled.

These buttons remain disabled until any TFL node is opened and the terms box is ticked. At this point, all the OK buttons are re-enabled.

tfl node doesn't get bus stops when httpAdminRoot is not default

if the node red admin root is not '/', the tfl node cannot get the stops and the lines to populate the config UI for the bus nodes.

remove leading / from the URL on lines 185 and 269 of tfl-bus.html as in the following will fix this.

       185     var url = 'tfl-bus/linesquery/?' + query;

       269     var url = 'tfl-bus/stopsquery/?' + query;

TFL Tube query node - return current status of selected tube line

This is a very simple query node which has been pulled out of the TFL node in issue #79.

Query Node

The user specifies which London Tube line they're interested in from a drop down list. The node queries the TFL API for the status of all London tube lines and then filters the result based on the user's input.

The status information is returned in the following way:

  • msg.description - text stating which line the status information is about
  • msg.payload.status - the TfL CssClass, for example "GoodService", "DisruptedService"
  • msg.payload.goodservice - a boolean, true if msg.payload.status is "GoodService", false otherwise
  • msg.payload.description - the description of the status, for example "Good Service", "Part Suspended"
  • msg.payload.details - the status details if they exist (they are only present when msg.payload.description is not "Good Service")
  • msg.payload.branchdisruptions - an arry of information about the disruptions if any exist
  • msg.data - object containing the full information about the requested line

Basic idea of UI:

tfl-disabled

tfl-enabled

tfl-options

Authentication

The user is required to register with the TFL (https://api-portal.tfl.gov.uk/). There is a checkbox in the UI for the user to declare they have done this. The "OK" button for the node is only enabled when this is done.

Google Calendar Node

Input Nodes

  • New events added to a calendar

Query Nodes

  • Get next event
    • node options
      • calendar - calendar to lookup events in
    • msg.options
      • calendar - calendar to lookup events in
      • payload - text search used to select relevant events (optional)
    • output msg properties
      • title - the summary string from the calendar entry
      • description - the description from the calendar entry
      • location.description - the location string from the calendar entry
      • data - the raw event from the google calendar query
      • payload object containing:
        • title - the summary string from the calendar entry
        • description - the description from the calendar entry
        • location.description - the location string from the calendar entry
        • start - Javascript Date of start time - midnight for all day event
        • end - Javascript Date of end time - midnight for all day event
        • allDayEvent - true if event is an all day event
        • creator - object containing name and email properties
        • attendees - list of objects containing name and email properties

Output Nodes

  • Add event to a calendar
    • node options
      • calendar - calender to add events to
    • msg.options
      • calendar - calendar to add events to
      • payload - string describing the event in quick add format

Calendars

The calendar option should be able to specified as the id string of the calendar, name of the calendar, or the string primary to use the users primary calendar. The default will be primary.

Eventbrite Node

Input Node

  • New (and optionally updated) events for which the user has tickets

Query Node

  • future events for which the user has tickets

Output Node

None?

The output message for events will be based on the documented XML. It might be a good idea to invert the structure so that the main object is the event rather than the order since it is likely that the event is the thing the user would want to process - for example to create a calendar entry.

Swarm Node (previously Foursquare node)

Node-RED currently provides the following Swarm capability:

Input Node:

The input node polls the Foursquare API every 15 minutes for the latest Swarm check-ins that have been made by the authenticated user since the node was registered. If a new check-in has been made within the polling interval then msg.payload is set to be the JSON of the most recent new check-in. The properties of the Swarm check-in are documented at https://developer.foursquare.com/docs/responses/checkin.

More specifically:

  • If the poll occurs after one or more new Swarm check-ins then msg.payload contains the JSON for the most recent check-in.
  • If the poll occurs when there's been no new check-in within the polling interval or since the node was registered then the node does not put anything in msg.payload.

Query Node

The query node sets msg.payload to be the JSON of the most recent Swarm check-in by the authenticated user since the node was registered. As with the input node, the properties of the JSON are documented at https://developer.foursquare.com/docs/responses/checkin.

More specifically:

  • If the query occurs after one or more check-ins then msg.payload is set to the JSON for the most recent check-in
  • If the query occurs after a period of time in which no new check-ins have been made then msg.payload is set to the JSON for the most recent check-in since the node was registered.
  • If the query occurs when there have been no check-ins since the node was registered then nothing is put in msg.payload.

Authentication

Users must register their own app with https://www.foursquare.com and paste the required access tokens into the node. Help is provided within the node UI.

Google Calendar Query Node - help text

The help text as displayed in the info tag doesn't appear to match the usage of the node. In use, the node follows the form that @hindessm describes in #16 in that the node returns the next calendar entry. and takes anything from msg.payload and adds that as a search term.
This however doesn't tally with the information in the info tab which suggests the node is for adding an event to the calendar.

Openweathermap node throws uncaught exception if API endpoint is down

4 Dec 11:40:02 - [red] Uncaught Exception:
4 Dec 11:40:02 - SyntaxError: Unexpected end of input
at Object.parse (native)
at IncomingMessage. (/home/zoltan/git/node-red-web-nodes/weather/weather.js:97:37)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

@Raminios , we should try to handle this gracefully, otherwise it kills the whole of Node-RED.

Thanks! ;)

OpenWeatherMap Node

Query Node

- Weather information pulled immediately from a certain specified location (city or coordinates).

Options

  • Location Type - City or Coordinates. Either makes certain extra options appear.

_Appears when coordinates is selected:_

  • Longitude - For the user to provide the longitudinal degree of the location.
  • Latitude - For the user to provide the latitudinal degree of the location.

_Appears when City is selected:_

  • City - For the user to provide the current city from which they wish to get the weather
  • Country - For the user to provide the current country in which that city is located.

Outputs

msg options

  • payload A brief verbal description of the current weather, humanly readable.
  • weather An extremely short description of the current weather (Clouds, Rain, Sun, etc.)
  • detail. A more detailed expansion on the weather description
  • tempk. The current ground temperature in Kelvin
  • humidity. The current humidity percentage.
  • maxtemp. The maximum temperature at the moment.
  • mintemp. The minimum temperature at the moment
  • windspeed. The current wind speed in metres per second
  • winddirection. The current wind direction in meteorological degrees
  • town. The exact source location for the weather data
  • long. The longitude of the location from which the weather data has been pulled.
  • lat The latitude of the location from which the weather data has been pulled.
  • sunrise. The time at which the sun rose.
  • sunset. The time at which the sun will set
  • clouds. The cloud coverage percentage.

Google Directions - node status not updating

having worked out why the Google directions node was misbehaving I can now successfully return directions information.
However the node-status is stuck as a red donut and "failed".

Refreshing the browser, & turning off & on the "display node status" still has status as "failed" even as results are being returned.

node-red-0 (out): 28 May 11:43:17 - [info] Node-RED version: v0.10.6
node-red-0 (out): 28 May 11:43:17 - [info] Node.js version: v0.10.28

Foursquare node allows for output to multiple messages, but does not modify the node's number of outputs.

The foursquare node allows the user to select how they would like to receive output. This works great as a single output, or multiple outputs in a single msg object. However, if you want multiple outputs in multiple msg objects, the node itself does not reflect the change in the number of outputs. Therefore, even though the code is passing an array of msgs, you only ever receive the first msg object at the next node. There needs to be an implementation much like how the 'switch' node handles adding an output.

@hbeeken, @hindessm - Am I misreading anything in the code path? It seems foursquare/foursquare.html:279 looks to set the number of node outputs to 1, and it is never changed.

redirection URIs for OAuth web nodes include colon when default ports are used

When node-red is deployed on the default http(s) ports (80/443), the redirect URIs for OAuth2 authentication in the web nodes include a colon.

For example: https://fred.sensetecnic.com:/red/google-credentials/auth/callback
should be: https://fred.sensetecnic.com/red/google-credentials/auth/callback

This causes problems with OAuth services that are strict about the callback URIs matching what is registered. Google will not accept a callback URI with a colon.

Also, related to this, instagram, and some others (strava?) do not include the path that NR is running on. For in the above example the /red/ part of the URI.

Forecast.io Node

Input Node

- Will be the same as the query node, but will ping the weather database periodically and output data when a change is detected.

Query Node

- 7 day forecast information from the current day, or weather information from a certain date and time, past or future.

Options

  • API Key - The user provided API key.
  • Forecast - 7 days from now, or specific date and time. Either makes certain extra options appear.
  • Longitude - For the user to provide the longitudinal degree of the location.
  • Latitude - For the user to provide the latitudinal degree of the location.

_Appears when specific date and time is selected:_

  • Date - A user provided date.
  • Time - A user provided time.

Outputs

TO BE DECIDED. Will be a similar format to the openweathermap output data.

Transport for London Buses node

Introduction

TODO: Discuss "search mode". => ask me

  • Search mode would be some way to make a query node operate with dynamic settings coming in as input. In search mode a bus query node could feed back bus information about nearby stops to the flow so that then a more appropriate query could then be sent to the same or a second bus query node. This is a very hazy idea but without designing something, it's hard to use the query node dynamically.

This node will use the Transport for London (TfL) provided "Live bus and river bus arrivals API". The API is documented as http://www.tfl.gov.uk/cdn/static/cms/documents/tfl-live-bus-and-river-bus-arrivals-api-documentation.pdf .

These nodes are Bus Stop focused. (Get bus stop data or events related to bus stops.)

Generally, we have the following two main scenarios we'd like to support:

  • Send a notification when a bus is about to approach/have left a particular bus stop: So that I leave home just in time to catch the bus => Input node
  • Send me bus departure/arrival information for the bus stop closest to a certain location or an exact bus stop: Useful for when I'm standing at a particular bus stop and waiting for buses. => Query node

TfL has more than 19000 bus stops, 700 bus routes and 8000 buses. Therefore listing all of them as options in a node are not viable.

  • Therefore the UI will support a two stage bus stop selector interface (both input and query nodes), where the user has to specify a pair of latitude and longitude coordinates and a radius. Using this, only bus stops within this radius will be listed.
  • Alternatively, the bus stop selector should support finding the closest bus stop to the user's current location. (No radius is specified)
  • Future versions could perhaps do more intelligent searches where a final destination is also considered for the buses serving a particular stop. This will NOT be implemented under this issue.

Input Node

The main purpose of the input node is to send out a notification message when certain events happen at bus stops. Examples: bus arrival, bus departure. => trigger a message.

Alternatively trigger a message n time before bus arrival.

  • UI options, NOT passed to flow:
    • lat/lon:Find a bus stop at a particular location
    • radius: Find a bus stop within a particular radius (using lat and lon). 0 Radius means finding nearest stop.
  • node options:
    • TfL Credentials: stored in credentials
    • Bus Stop: a drop down from which the user selects the actual bus stop. The option actually just sets a particular bus stop ID integer (as per API)
    • Arrival/Departure: Whether we're interested in bus's departure/arrival
    • Line number (fetch for particular bus stop, show as drop down): Which bus line/route we're interested in
    • Advance notice (milliseconds): How much advance notice do we want before the actual departure/arrival is predicted to happen?

The node refreshes state every 30 seconds as the API refreshes its state this frequently.

Query Node

The query node is mainly used to get status for a particular bus stop if we are already waiting at the stop for a bus. It can give us information about when a particular bus arrives/leaves the stop. The arrival/departure prediction is queried & then sent upon incoming input message.

  • UI options, NOT passed to flow:
    • lat/lon:Find a bus stop at a particular location
    • radius: Find a bus stop within a particular radius (using lat and lon). 0 Radius means finding nearest stop.
  • node options:
    • TfL Credentials: stored in credentials
    • Bus Stop: a drop down from which the user selects the actual bus stop. The option actually just sets a particular bus stop ID integer (as per API)
    • Arrival/Departure: Whether we're interested in bus's departure/arrival
    • Line number (fetch for particular bus stop, show as drop down): Which bus line/route we're interested in.

Issues to be considered

  • API endpoint is http://countdown.api.tfl.gov.uk/interfaces/ura/instant_V1
  • API returns JSON but it might not match all standards apparently due to "performance reasons" apparently
  • The user needs to register with TfL and the user also needs to register their IP address as an approved client
  • Node settings dialog must say "Data provided by Transport for London"
  • Important factor to consider: stop closures, messages relating to certain stops => do we want to show/list closed stops?
  • currently we're on v 1.5 of the API
  • apparently a bus stop might not have any real time info attached to it, this is to be handled
  • null values in StopCode1, StopCode2, StopPointType or StopPointIndicator might mean that the stop is out of service or is a bus stand
  • StopID is the primary data key
  • Lat and lon data for a particular bus stop might be returned in scientific notation (example 1.87E-4)
  • Bus stops have a property of stopPointType which could signal a "dummy" stop or stops for announcement systems, etc. Referring to the docs is essential.

Example flows:

* I'm at home, my home geocoordinates are X, Y. I'm heading to work. I need notification when to leave home (takes me 5 minutes to walk to bus stop). So I need to get a 7 minute advance warning when bus number N is about to depart from stop.

Dropbox node HTML help to be revised

@hindessm , I've been looking at the description of the Dropbox nodes. I personally believe, they could be clearer and updated.

The most confusing one is the Dropbox query node. The first sentence of the description says "Dropbox input node". I think a different term should be invented for similar nodes or the action described better.

For the Dropbox input node, is "watch node" a defined term? How about "glob pattern"?

I would also prefer to read text split into paragraphs.

I hope I'm not too harsh here, what do you think?

Box.com node

Input

  • Watch for changes to box.com:
    • node options
      • filepattern - minimatch/glob pattern to filter files on (optional, default include all files)
    • output msg properties
      • payload - the full path of the changed file
      • file - the basename of the changed file
      • event - the type of event either add or delete
      • data - the raw change object from the api call response

Query

  • Get box.com file contents
    • node options
      • filename - full path of file to retrieve
      • localfilename - local file to write content to (optional - defaults to storing content in payload)
    • msg options
      • filename - full path of file to retrieve
      • localfilename - local file to write content to
    • output msg properties
      • payload - the content of the file (deleted if there is an error)
      • filename - the full path of the file retrieved
      • error - an error object (deleted if the request was successful)

Outputs

  • Write to a file (create/replace)
    • node options
      • filename - filename of the remote box.com file
      • localFilename - local filename containing the content to be uploaded to box.com
    • msg options
      • filename - filename of the remote box.com file
      • localFilename - local filename containing the content to be uploaded to box.com
      • payload - the content to be uploaded (localFilename takes priority)

Authentication

Uses oauth2 with access token with a 1 hour lifetime and a refresh token with a 60-day lifetime. The refresh token is updated every time we update the access token for a request but we might want to make sure the node triggers a refresh of the access token every few days when no other requests have been made to ensure the refresh token remains valid.

openweathermap suddenly returning 'The API call returned invalid JSON

The openweathermap node suddenly stopped working on Oct 10th 2015 at app 5:45AM EST. This showed up on three sites I've deployed in seperate locations. I've set up a test site and the only message I get in the debug or log is:
13 Oct 06:06:34 - [error] [openweathermap:Weather] The API call returned invalid JSON

any ideas?

Fitbit moving to Oauth2

I've just received 8 identical Emails from fitbit ( I guess they really wanted to tell me!) to let me know that they are moving from OAuth1.0 to OAuth2.0

"Applications should upgrade to OAuth 2.0 by March 14, 2016. OAuth 1.0a support will be removed from the Fitbit Web API six months from now on April 12, 2016. Documentation for using OAuth 2.0 with the Fitbit Web API is available at https://dev.fitbit.com/docs/oauth2 ."

Foursquare node - recommended venues (returns one result)

Query Node

The node uses

  • msg.location.lat and msg.location.lon properties in the incoming message
  • msg.section or node.section (options are "food", "outdoors", "sights")

as the basis for the venue search for the specified section of venues. It then makes a call out to the Foursquare venue API for the list of recommended venues near this location. In this first version, only the first in the ordered list of recommended venues from Foursquare is returned to the user with

  • msg.payload = full JSON representation of the recommended venue
  • msg.location.lat = latitude of the recommended venue
  • msg.location.lon = longitude of the recommended venue
  • msg.title = name of the recommended venue

UI

The ui has a drop down to enable the user to choose which type of venue to search for, the options being "food", "outdoors" and "sights". There is also an empty option which enables the user to configure the node using the incomming msg.section.

The ui also provides the user with the ability to choose how many results are going to be returned. In this first version the only option is to return one result.

foursquare-basic-ui

Notes

  • The node is entitled "Foursquare" as it searches for recommended venues. This is still part of the Foursquare functionality rather than Swarm
  • The authentication is shared with the Swarm node, using the "foursquare-credentials" already defined in the Swarm node.
  • "recommended" is as defined in the Foursquare API (https://developer.foursquare.com/docs/venues/explore)
  • Although OAuth authentication isn't required in order to use the Foursquare venues API, doing so means that the recommendations are more relevant to the user. Also if a user has already authenticated with Foursquare for the Swarm node, it makes sense to use this information. Therefore, OAuth authentication is required in order to use this node.

Foursquare Node - recommended venues (return multiple results)

Query Node

The node uses

  • msg.location.lat and msg.location.lon properties in the incoming message
  • msg.section or node.section (options are "food", "outdoors", "sights")

as the basis for the venue search for the specified section of venues. It then makes a call out to the Foursquare venue API for the list of recommended venues near this location.

The user can specify how many results to return along with how these should be returned, either as a single message or as multiple messages. If the number requested is greater than the number of results returned from the Foursquare query, all results are returned.

For what's returned and when see Nick's comment below....

UI

The ui has a drop down to enable the user to choose which type of venue to search for, the options being "food", "outdoors" and "sights". There is also an empty option which enables the user to configure the node using the incomming msg.section.

The ui also provides the user with the ability to choose how many results are going to be returned and how this is to be returned (either a single message or multiple messages)

foursquare-multiple-ui

Notes

  • The node is entitled "Foursquare" as it searches for recommended venues. This is still part of the Foursquare functionality rather than Swarm
  • The authentication is shared with the Swarm node, using the "foursquare-credentials" already defined in the Swarm node.
  • "recommended" is as defined in the Foursquare API (https://developer.foursquare.com/docs/venues/explore)
  • Although OAuth authentication isn't required in order to use the Foursquare venues API, doing so means that the recommendations are more relevant to the user. Also if a user has already authenticated with Foursquare for the Swarm node, it makes sense to use this information. Therefore, OAuth authentication is required in order to use this node.

Flickr Node - not installing

Can't seem to install the Flickr node on brand new installation of NodeJS and Node-RED on Raspberry Pi2.

It appears to install fine with NPM but then doesn't show up in the Node-RED editor. See output of node-red -v below:

18 Aug 10:06:05 - [info] Node-RED version: v0.11.1
18 Aug 10:06:05 - [info] Node.js version: v0.12.6
18 Aug 10:06:05 - [info] Loading palette nodes
18 Aug 10:06:13 - [warn] ------------------------------------------
18 Aug 10:06:13 - [warn] [flickr] Error: Cannot find module 'oauth'
18 Aug 10:06:13 - [warn] ------------------------------------------

Strava fitness nodes

Introduction

We'd like to support three possible scenarios with the Strava fitness node initially:

* Use case 1 (current priority focus): Poll the authenticated user's activities and get details for the most recently uploaded activity => Can be used in flows that check if the user has indeed done scheduled (Google Calendar) activity. If the user has not done activity, certain actions can be taken (re-schedule activity, send text message to coach, notify user to upload activity, etc.)

* Use case 2: I'm in a new location, I would like to get segments for the nearby area. This is to be used in Location-based flows to find new exercise routes in an unknown area. => Problem is that segments are NOT actual routes. Routes cannot be retrieved using Strava.

* Use case 3: Get activities of friends. => Could be used for route finding in a very complicated, unnatural way. => Get activities of friends => Check location of activity => If near current location, use as recommendation?

Get Activities for authenticated user:

http://strava.github.io/api/v3/activities/#get-activities

Get details on activity:

http://strava.github.io/api/v3/activities/#get-details

Get Segments in given area:

http://strava.github.io/api/v3/segments/#explore

Retrieve details for a given segment:

http://strava.github.io/api/v3/segments/#retrieve

Input Node

Can be used to send out initial message if:

  • Authenticated user creates a brand new activity (initial focus)
  • Friends of authenticated user creates a new activity (won't implement this under this issue)
    • node options:
  • NONE! There's no need. Simply keep getting latest activity, see if activity ID changes. Then send out message with the activity's details.

Query Node

Activity mode:

Can be used to query the most recent activity of:

  • The authenticated user (intial focus)
  • Or the most recent activiti(es) uploaded by the user's friends (won't implement under this issue)

Segment mode:

  • Provide location => Get segment(s)
  • Get details for all/a particular segment
    • node options:
  • Mode: Segment mode/Activity mode
  • Location: Usual data, only useful for segment mode
  • Number of items to return: Whether to return a single (most recent) activity/segment or more.

OAuth is used to authenticate user with Strava.

To be added to credentials as usual.

http://strava.github.io/api/#access

Facebook Node

Input Node

  • New status (posted by you or one in which you are tagged)
  • New photo (posted by you or one in which you are tagged)
  • New link
  • Profile change

Query

  • Fetch photo
  • Fetch album contents

Outputs

  • Upload photo to an album
    • node options
      • album
      • localFilename - local filename containing the content to be uploaded
    • msg options
      • localFilename - local filename containing the content to be uploaded
      • payload - the content to be uploaded (localFilename takes priority)
      • delete - if set, the remote file will be deleted from the album
      • photo_id - used to identify the photo to be deleted

Authentication

Users must register their own app at https://developers.facebook.com/ and paste the required tokens into the node. The user must then do the oauth in the browser to get a short-term access token. This can be exchanged for a long-term (60-day) access token. The long-term token must be refreshed but the user is expected to be available to confirm if required. Status messages can only be posted using short-term access tokens.

Notes

Test users may be created see https://developers.facebook.com/docs/graph-api/reference/v2.1/test-user
Access tokens are described at https://developers.facebook.com/docs/facebook-login/access-tokens
There are two main candidates for node wrappers for the API:

Fitbit Node

Input Node

  • New goal reached during a day
  • New sleep log available
  • New badge

Query Node

  • Return daily data for activities, sleep, etc
  • Return lifetime data such as badges achieved

Output Node

  • Log weight, activities, heartrate, etc

Authentication

Users must register their own app at https://dev.fitbit.com/apps/new and paste the client key and client secret into the configuration node then complete an oauth authorization.

Unit System

The credential node should enable the configuration of the unit system

Delicious Node

Input Node

  • A new bookmark has been added
    • tbd

Output Node

  • Add a new bookmark
    • node options

      • tags - comma separated list of tags to apply to all photos
      • private - default privacy option (boolean)
    • message option

      • payload - the url to save (required)
      • title - the title for the bookmark (required)
      • description - the long description for the bookmark (optional)
    • example flow

      [twitter: following a hashtag] - [function: extract any urls] - [delicious: add bookmark]

Query/Function Node

  • none

Authentication

  • User will have to provide their username/password

Google Calendar: Wrong info in config when using .local domains

Hello,

In the Google Calendar node, when using it from a .local domain, the configuration information in the node seems to think .local is a public domain and doesn't give the correct information (regarding the correct domain to use as a callback uri and the modification of the hosts file.
Accessing the same instance with the ip address shows the correct message.

Passing credentials to instagram node

I am using node-red as backend of my application. I pass flows to node-red using runtime api and with POST request to /flows.

I authenticate my app to instagram and pass received token to node-red like following array:

[
    {
        "type": "instagram",
        "instagram": "",
        "inputType": "like",
        "outputType": "link",
        "name": "",
        "x": 123,
        "y": 321,
        "wires": [
            []
        ],
        "credentials": {
            "client_id": "my_client_id_from_instagram_panel",
            "client_secret": "my_client_secret_from_instagram_panel",
            "redirect_uri": "http://127.0.0.1:7070/red/instagram-credentials/auth/callback",
            "code": "auto_generated_hash_code",
            "username": "my_instagram_usename",
            "access_token": "received_token_from_instagram"
        }
    }
]

but when I POST this array to /flows url of api. the imported node doesnt have any credentials and cant access instagram images.
is there any solution for this matter ?

Runkeeper (HealthGraph) fitness nodes

Introduction

We'd like to support three possible scenarios with the Runkeeper fitness node initially (we'd like to have the capability to drop in/exchange Runkeeper nodes with Strava nodes so issue #92 is closely related and is almost identical to this issue ):

* Use case 1 (current priority focus): Poll the authenticated user's activities and get details for the most recently uploaded activity => Can be used in flows that check if the user has indeed done scheduled (Google Calendar) activity. If the user has not done activity, certain actions can be taken (re-schedule activity, send text message to coach, notify user to upload activity, etc.)

* Use case 2: Segments => NOT supported by Runkeeper. Runkeeper supports "Records" but they're personal records (say activities number per week, etc.) so it can't be drop-in/replaced.

* Use case 3: Get activities of friends. => Again, NOT possible on Runkeeper.

Get Activities for authenticated user:

http://developer.runkeeper.com/healthgraph/fitness-activities

Input Node

Can be used to send out initial message if:

  • Authenticated user creates a brand new activity (initial focus)
    • node options:
  • NONE! There's no need. Simply keep getting latest activity, see if activity ID changes. Then send out message with the activity's details.

Query Node

Can be used to query the most recent activity of:

  • The authenticated user

OAuth is used to authenticate with Runkeeper.

To be added to credentials as usual.

http://developer.runkeeper.com/healthgraph/registration-authorization

Fatsecret Calorie Counter Node

Query Node

Will pull calorie and food information that the user has input for a certain date from their Fatsecret account. This date can either be supplied in the node settings or as a the msg.time. There will also be a "yesterday" and "today" option.

Input Node

A polling system could be used to output a food whenever a new food is added to the user's diary. This feature is currently only proposed though.

Output Node

The API allows the user to add foods to their diary. A node could be implemented which would attach itself to a specific food and add it to the user's diary at time of input (similarly to the TFL cycle hire node pulling information to a set station).

A node like this would be useful for allowing the user to automatically add foods they regularly eat (add coffee every morning, add my favourite meal if a foursquare checkin at a restaurant etc.)

However, this would require accessing the API using credentials (an issue not present in the TFL API) and as this is the UI trying to access credentials, they often aren't yet in the runtime. This causes complications.

There are also exercise functions in the app and API, which could be used in conjunction with runkeeper or strava.

Options

  • credentials - the user will need to register for the api and follow the OAuth procedure to gain access to the API and use the node.

Query node

: There will be a drop down box in which the user can choose from: - `Today` - Will use the day's date to pull information. - `Yesterday` - Will use yesterday's date to pull the information. - `Date` - Will allow the user to specify a date from when to pull the information. - `Input` - Will use the date specified in the msg.input.

Outputs

The output will be an object containing 4 arrays:

  • breakfast - Will contain foods eaten that day for breakfast.
  • lunch - Will contain foods eaten that day for lunch.
  • dinner - Will contain foods eaten that day for dinner.
  • other - Will contain foods eaten that day outside of meals (snacks).

These arrays will contain several (or zero) objects with these properties:

  • food - Text name of the food.
  • calories - Number of calories of that food eaten.
  • serving - Size of serving of the food eaten.
  • amount - Amount of servings of the food eaten.

Syntax error in Weather Underground node

Building a fresh Docker container for a Raspberry Pi tonight and getting this error at module load time:

nodered_1   | 22 Jul 05:00:36 - [warn] [wunder] SyntaxError: /usr/local/lib/node_modules/node-red-node-weather-underground/wunder.js:87
nodered_1   |                     else {
nodered_1   |                     ^^^^

The build is with node.js 0.12 + Node-RED 0.11 but I am pretty well convinced that this is a simple fix.

Transport for London Tube node

Introduction

This node will use the Transport for London (TfL) provided "Network Status & Train Prediction Services Development Beta SDK v0.2" (Tube departure boards, line status and station status). The API is documented at http://www.tfl.gov.uk/cdn/static/cms/documents/trackernet-data-services-guide-beta.pdf .

These node are Line & Tube station focused. (Get data about a particular line or get data about a particular station as part of a line).

Generally we have the following scenarios we'd like to support:

  • Send me a notification when a train is about to arrive/depart from a particular station and line and towards a given direction. Advance warning is possible. => most useful as an input node
  • Send me a notification when any event occurs at a station/when a failure/warning is issued for a station or a line. => input node
  • Send me the train departure/arrival information at a particular station and line and direction. I'm already at the platform and I'm interested in all data. => query node

The API is in XML so an XML parser is to be picked for use. The API doesn't support location based on latitude/longitude so the user will have to select the underground line from a drop-down. Then they'll need to select the relevant station. Then the desired terminal direction of the trains. It's only then possible to send relevant information. Partial data input is possible (say only selecting a line gives line status, only selecting a line & station but not direction gives station info).

Input Node

  • TfL Credentials: stored in credentials
  • line: Select tube line from pre-programmed values. Triggers tube line status query which fetches station names and populates next drop down.
  • Station: Select a station on this particular line. Fetch all approaching trains final directions.
  • Direction: Determine the direction of the train service.
  • Arrival/departure: Are we to be notified about the departure or arrival of a train
  • Advance notice: How much advance notice is to be given before actual arrival/departure.

Query Node

  • TfL Credentials: stored in credentials
  • line: Select tube line from pre-programmed values. Triggers tube line status query which fetches station names and populates next drop down.
  • Station: Select a station on this particular line. Fetch all approaching trains final directions.
  • Direction: Determine the direction of the train service.

Issues to be considered

  • Query simple train prediction service for a line => Gets all stations. => Query detailed train predictions service for a line and station => gets detailed departure info of all trains => filter by terminal station
  • data is in XML format, so needs different processing to buses node. XML parser/technology to be agreed on.
  • We should add a disclaimer that the data/nodes should not be used in train safety applications. This disclaimer is also sent out in the detailed prediction service XML by TfL.
  • Add attribution to TfL: "Data provided by Transport for London"

Installing Wunderground nodes kills node-node connections in display

Node-RED version: v0.10.10
node-red-0 (out): 10 Aug 11:46:02 - [info] Node.js version: v0.10.28
(running on MacOSX10.10.4)

If I install the wunderground nodes and restart NR the flow is initially displayed as in the first image
node-red___192_168_0_22
and then a second or two later it "fixes" the position of the nodes but without any connections(image2)
node-red___192_168_0_22_2

tested on both Google Chrome 44.0.2403.130 and Safari 8.0.7 (10600.7.12) (both on MacOSX10.10.4)

If I uninstall the wunderground nodes normality is restored.

Console Errors:

[Error] TypeError: undefined is not a function (evaluating 'this._("wunder.label.wunder")')
label (undefined, line 19)
(anonymous function) (red.min.js, line 17)
(anonymous function) (vendor.js, line 1142)
Tn (vendor.js, line 1140)
each (vendor.js, line 1142)
x (red.min.js, line 17)
(anonymous function) (red.min.js, line 17)
emit (red.min.js, line 17)
onchange (red.min.js, line 17)
d (red.min.js, line 17)
b (red.min.js, line 17)
dispatch (vendor.js, line 3)
handle (vendor.js, line 3)
[Error] TypeError: null is not an object (evaluating 'e.getAttributeNS')
attr (vendor.js, line 1142)
(anonymous function) (red.min.js, line 18)
(anonymous function) (vendor.js, line 1142)
Tn (vendor.js, line 1140)
each (vendor.js, line 1142)
x (red.min.js, line 17)
redraw (red.min.js, line 18)
(anonymous function) (red.min.js, line 16)
onmessage (red.min.js, line 16)

Travis

Hi @knolleary, @dceejay,

Please can you enable travis and coveralls test/reporting for this repository? So we get errors reported for pull requests.

-Mark.

Barclays Cycle Hire Node

Query Node

The user has the choice of either:

  • Single station - Fixes the node to return information on a single cycle station. Due to the vast amount of stations to choose from, it is likely that there will be some sort of system in the UI to help the user find the station they are looking to enter.
  • Location Based - Returns information based upon a certain number of factors provided by the user.
    The user will provide a location and parameters (available bikes, available spaces) and the node will return the nearest X stations (where X is user provided).

Input Node

  • Single station - The same as the query node - fixed to a single station. Will offer the user several settings to decide when data should be output (certain number of open spaces/bikes).
  • Location Based - The user will specify a location, a radius and a certain amount of criteria for stations within that radius to be output (if a station within the radius has 3 or less bikes available, outpu).

Options

  • API Key - The user provided API key for the TFL feed.

Input node

: Either: - `Longitude` - For the user to provide the longitudinal degree of the location. - `Latitude` - For the user to provide the latitudinal degree of the location. - `Radius` - A radius from the geolocation to check all stations within. - `Bikes available` - The amount of available bikes required at a station within the radius. - `Spaces available` - The amount of available stations required for a station to be output. - `Locked` - Whether or not the user wants locked stations to be returned.

Or:

  • Station - A drop down menu of street names corresponding to the stations.

Query node

: Either: - `Longitude` - For the user to provide the longitudinal degree of the location. - `Latitude` - For the user to provide the latitudinal degree of the location. - `number of bikes` - The amount of nearest stations to return. - `Bikes available` - The amount of available bikes required for the station to be selected. - `Spaces available` - The amount of available stations required for the station to be selected. - `Locked` - Whether or not the user wants locked stations to be returned.

Or:

  • Station - A drop down menu of street names corresponding to the stations.

Outputs

  • name - Text description of the street in which the station is e.g River Street, Clerkenwell.
  • lat - latitude location of the station.
  • lon - longitude location of the station.
  • locked - a boolean which tells the user whether or not the station is locked. If the station is locked, the user can return a bike, but not retrieve it.
  • bikes - The amount of available bikes at the station.
  • spaces - The amount of open spaces at the station.

Instagram Node

Input Node

  • Exactly the same as the query node, however it has an auto poll every 15 minutes

Output Node

  • Not implemented under this issue as there's limited scope to Instagram output only (comments, likes)

Query/Function Node

  • incoming msg triggers the node. The node checks if a new photo is added to (a user's) stream/a photo is liked by a user then we process the given photos. (Currently only acceptable user is the one logged in via credentials).
    • node options

      • user is currently hard-coded to "self", we might want to add support for multiple users later
      • type - photo : use uploaded photo(s), like : use likes
      • output - stream : payload will be an image buffer/stream, link : payload will be a string URL pointing to the image
    • message options

      • msg.payload : either an image as a buffer or a string/URL pointing to the image => here we currently default to linking/downloading the "big" (640x640) image. (Future feature could be to fetch the "medium" or "small" images)
      • msg.lat, msg.lon, msg.time: If additional metadata is available for the given photo then the node populates the msg object with additional location information (lat, lon for latitude, longitude) and msg.time carries a JavaScript Date object, representing the capture time of the photo.
    • example flows

      [inject node] - [instagram : we posted image 5678] - [irc - send message to IRC channel about image posted]
      [inject node] - [instagram : we liked image 5678] - [dropbox - back up image on dropbox]

Authentication

Amazon S3 Node (using AWS configuration node)

Input

  • Watch for changes to an S3 bucket:
    • node options
      • bucket - the bucket to watch
      • filepattern - minimatch/glob pattern to filter files on (optional, default include all files)
    • output msg properties
      • payload - the full path of the changed file
      • file - the basename of the changed file
      • event - the type of event either add or delete

Query

  • Retrieve a file from an S3 bucket:
  • Get S3 file contents
    • node options
      • bucket - bucket to retrieve file from
      • filename - full path of file to retrieve
      • localfilename - local file to write content to (optional - defaults to storing content in payload)
    • msg options
      • bucket - bucket to retrieve file from
      • filename - full path of file to retrieve
      • localfilename - local file to write content to
    • output msg properties
      • payload - the content of the file (deleted if there is an error)
      • bucket - the bucket the file was retrieved from
      • filename - the full path of the file retrieved
      • error - an error object (deleted if the request was successful)

Outputs

  • Write to a file (create/replace)
    • node options
      • bucket - a bucket to store files in
      • filename - filename of the remote s3 file
      • localFilename - local filename containing the content to be uploaded to s3
    • msg options
      • bucket - override the node configured bucket
      • filename - filename of the remote s3 file
      • localFilename - local filename containing the content to be uploaded to s3
      • payload - the content to be uploaded (localFilename takes priority)

Authentication

Users must register their own app at http://aws.amazon.com/ and paste the access key id and secret access key into the node.

Google Calendar Authentication Issue

I followed the instructions in the Google Calendar Node (config node) -
( the google instructions are out of date in terms of their site navigation)

I used the address given after the following: "Please configure the authorized Redirect URIs of your app to include the following url:http://192.168.0.43:1880/google-credentials/auth/callback"
and successfully created a ClientID and Secret.

However, on clicking "Authenticate with Google" I get the following error:

  1. That’s an error.

Error: invalid_request

device_id and device_name are required for private IP: http://192.168.0.43:1880/google->credentials/auth/callback

Any ideas?

Redirection trouble with raspberry pi

HI all,

Here's my trouble,

I'm using the google calendar node on a raspberry pi (I access it via a computer). I wrote an entry in hosts, created an app with the right redirect URI ("node-red-example.com").

But when I try to authenticate with google, after having accepted the permissions, the redirection to the page "Authorised - you can close this window and return to Node-RED" fails (web browser returns a 105 error code), I think it is because the DNS does not know the "node-red-example.com" domain...

It only works if i replace manually the "node-red-example.com" with my raspberry IP in the failing URL, do you have any solution to provide having to do it by myself each time ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.