Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (24 sloc) 0.814 kb
noflo = require "noflo"
base = require "./BasecampComponent"
class ReadProjects extends base.BasecampComponent
constructor: ->
do @basePortSetup
@outPorts =
out: new noflo.Port()
@inPorts.apikey.on "disconnect", =>
do @readProject if @hostname
@inPorts.hostname.on "disconnect", =>
do @readProject if @apikey
readProject: ->
@get "/projects.xml", (data) =>
@parseProject data
parseProject: (data) ->
target = @outPorts.out
id = "https://#{@hostname}/"
@parse data, (parsed) ->
target.beginGroup id
target.send project for project in parsed.project
target.endGroup()
target.disconnect()
exports.getComponent = ->
new ReadProjects
Jump to Line
Something went wrong with that request. Please try again.