Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bvalosek/teamworkpm-js
Javascript TeamworkPM API for the browser and Node
https://github.com/bvalosek/teamworkpm-js
Last synced: 10 days ago
JSON representation
Javascript TeamworkPM API for the browser and Node
- Host: GitHub
- URL: https://github.com/bvalosek/teamworkpm-js
- Owner: bvalosek
- Created: 2013-01-26T18:25:07.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-29T16:14:30.000Z (almost 12 years ago)
- Last Synced: 2024-04-29T21:10:31.444Z (8 months ago)
- Language: JavaScript
- Size: 641 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TeamworkPM Javascript API
=========================Javascript wrapper for TeamworkPM's API for both the browser and Node.
## Example ##
Real simple stuff.
```javascript
var teamworkPM = new TeamworkPM({
apiKey: 'myApiKey',
siteUrl: 'http://mysite.teamworkpm.net'
});teamworkPM
.fetchMe()
.then(function(me) {
console.log('Hello ' + me.attributes.username);return teamworkPM
.getProject(1234)
.getTasklists()
.userId(me.id)
.showMilestones()
.status('active')
.filter('upcoming')
.includeOverdue()
.fetch()
})
.then(function(lists) {
return lists.fetchTimeEntries();
})
.then(function(lists) {
console.log(lists.stats());
});
```Boom.
This is what we just did:
* Setup the API connection
* Get the user's info
* Politely greet the user
* Get all task lists that:
* Are assigned to the user
* Are active
* Are upcoming or overdue
* Load any corresponding time entries into the task lists
* Display stats about all task lists## Dependencies ##
* Backbone
* jQuery
* underscore.js
* moment.jsIf running on the server with Node, you'll need the request and JQDeferred packages as well in the place of jquery's ajax and the Deferred object.