10 Web Nodes outline
hbeeken edited this page 2014-11-12 05:46:19 -08:00

This is a list of web APIs we want to start creating nodes for.

For each service there are some thoughts of the types of input/query/output capabilities we might want. Some need further investigation to see what they expose in their API.

Some use HTTP(S) callback for event notification. This will only be possible with a public facing host e.g. bluemix. Some have alternative polling based apis which we can use.


FourSquare/Swarm

https://github.com/node-red/node-red-web-nodes/tree/master/foursquare

Issues
  • Input events require https callback. There is a URL which can be polled (although this isn't the recommended usage, it is ok for the first pass of the node).
  • API currently only supports polling check-in information of the authenticated user (https://developer.foursquare.com/docs/users/checkins - "self" is only supported). However, can get the list of friends for the authenticated user and then see which check-ins they've made so there may be a way around it. This needs clarification and looking into.
Inputs
  • New checkin for the authenticated user - done
  • New checkin for another user
  • New checkin from authenticated user's friends

Notes:

  • Only return a new check-in since the node was initialized
  • Polls every 15 mins
  • Could consider adding additional filter options - tag, category, geographic region...
Query
  • Poll the check-in URI to get the list of check-ins for the authenticated user ('self') - done
  • Poll the check-in URI to get the list of check-ins for a 'friend' - not sure if possible
Outputs
  • Create a checkin event
Notes
  • Foursqure 8.0 split into Foursquare and Swarm. Foursquare being the "give me all the chinese restaurants near me" type capability and Swarm being the "check-in", more social capability (https://developer.foursquare.com/docs/2014update). Therefore anything check-in related needs to be named Swarm, as we have done.

Dropbox

Inputs
  • New file in a watched folder
Query
  • Get file contents
Outputs
  • Write to a file (replace/append)

Facebook

Inputs
  • Need to review API to see what events we can monitor
Query
  • ... lots ...
Outputs
  • Status update
  • Link share
  • Upload photo to a specified album

Delicious

https://github.com/node-red/node-red-web-nodes/tree/master/delicious

Inputs
  • ...
Outputs
  • Add a bookmark

Flickr

https://github.com/node-red/node-red-web-nodes/tree/master/flickr

Inputs
  • Added a photo (filter by tag etc)
Outputs
  • Upload photo

Instagram

Input events require https callback.

Inputs
  • Added a photo (filter by tag etc, photo OR video?)
  • Like a photo
  • A specific user has added a photo
Outputs

API is currently read-only... no outputs possible


Box

Inputs
  • ...
Query
  • Get file content
Outputs
  • Write to a file (replace/append)

Strava

(similar to Runkeeper)

Input node
  • Authenticated user has completed a new activity - provides location information for the basis of flows
Query node
  • Query my friends activities - could then be used in conjunction with my current location in a flow to see if any friends have completed activities within a certain area and then email/text the friend to ask for their route (might get around lack of route API)
  • Query my activities ** find my most recent activity (provides location information) ** find my fastest/"best" activity (use in a flow.....?)
Output node

I'm not sure there is a use case for an output node. The API does enable activities etc. to be updated, however, the user is likely to already have created/updated an activity via the phone app when the activity has been completed.

Notes
  • No plans to expose routes through the API. This would mean flows along the lines of "I have an event at location x, find me running routes around location x"
  • There is a "segment explorer" API which enables the user to search for popular segments within a given area. This could be used if the user wants to use this as a basis/start point of their route. Not sure, however, the benefit of doing this in node-RED as opposed to within the app.
  • Authentication is done using OAuth2
  • there are rate limits: The default rate limit allows 600 requests every 15 minutes, with up to 30,000 requests per day.
  • T&Cs: http://www.strava.com/api-agreement
  • There are javascript libraries which we could use to wrap the API calls but I think it's just as easy to make the API calls ourselves

Runkeeper

(similar to Strava)

Input node
  • Authenticated user has completed a new activity - provides location information for the basis of flows
Query node
  • Query my friends activities - could then be used in conjunction with my current location in a flow to see if any friends have completed activities within a certain area and then email/text the friend to ask for their route (might get around lack of route API)
  • Query my activities ** find my most recent activity (provides location information) ** find my fastest/"best" activity (use in a flow.....?)
Output node

I'm not sure there is a use case for an output node. The API does enable activities etc. to be updated, however, the user is likely to already have created/updated an activity via the phone app when the activity has been completed.

Notes
  • No mention of routes in the API, although this capability is available via the web interface. This would mean flows along the lines of "I have an event at location x, find me running routes around location x"
  • Doesn't seem as rich as Strava
  • Authentication is done using OAuth2
  • HealthGraph is the API which is associated with Runkeeper
  • T&Cs http://developer.runkeeper.com/healthgraph/api-policies ** can't use runkeeper icons ** cant duplicate functionality provided by runkeeper/healthgraph ** must adhere to the privacy settings of the different users
  • There are node.js libraries which we could use to wrap the API calls but I think it's just as easy to make the API calls ourselves

MapMyFitness

Input node
  • Authenticated user has completed a new workout - provides location information for the basis of flows
Query node
  • Query routes near a location - a flow could then query results based on a certain criteria (these could either be put into the query or done as a function node afterwards)
Output node

I'm not sure there is a use case for an output node. The API does enable activities etc. to be updated, however, the user is likely to already have created/updated an activity via the phone app when the activity has been completed.

Notes
  • Has "courses" which are equivalent to Stravas "segments"
  • Authentication is done using OAuth2
  • "workout"s are equivalent to Strava and Runkeeper "activities"
  • https://www.mapmyapi.com/docs/