Skip to content

Commit

Permalink
Add "followers_stats", "status_update_stats" and "update" in companie…
Browse files Browse the repository at this point in the history
…s API
  • Loading branch information
gpiroux committed Dec 17, 2015
1 parent 248c1cf commit 076b0b6
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lib/services/companies.js
Expand Up @@ -23,22 +23,28 @@
this.company = function(id, cb) {
this.createCall('GET', 'companies/' +id + ":(" + fields.join(',') + ")", cb)(this.config);
};

this.company_stats = function(id, cb) {
this.createCall('GET', 'companies/' +id + "/company-statistics", cb)(this.config);
};
this.company_historical_follower_stats = function(id, start, end, cb){

this.company_historical_follower_stats = function(id, start, end, cb) {
this.createCall('GET', 'companies/' +id + "/historical-follow-statistics", {"time-granularity": "day","start-timestamp": start,"end-timestamp": end}, cb)(this.config);

this.followers_stats = function(id, options, cb) {
this.createCall('GET', 'companies/' +id + "/historical-follow-statistics", options, cb)(this.config);
};

this.company_historical_status_update_stats = function(id, start, end, cb){
this.company_historical_status_update_stats = function(id, start, end, cb) {
this.createCall('GET', 'companies/' +id + "/historical-status-update-statistics", {"time-granularity": "day","start-timestamp": start,"end-timestamp": end}, cb)(this.config);

this.status_update_stats = function(id, options, cb) {
this.createCall('GET', 'companies/' +id + "/historical-status-update-statistics", options, cb)(this.config);
};

this.name = function(name, cb) {
this.createCall('GET', 'companies/universal-name=' + name.split(' ').join('-') + ":("+ fields.join(',') + ")", cb)(this.config);
}
};

this.email_domain = function(domain, cb) {
this.createCall('GET', 'companies', {"email-domain": domain}, cb)(this.config);
Expand All @@ -54,14 +60,18 @@

this.updates = function (id, options, cb) {
if (_.isFunction(options)) {
cb = options;
options = {};
cb = options;
options = {};
}
this.createCall('GET', 'companies/' + id + '/updates', options, cb)(this.config);
};

this.share = function (id, options, cb) {
this.createCall('POST', 'https://api.linkedin.com/v1/companies/' + id + '/shares', {json:options}, cb)(this.config);
this.createCall('POST', 'https://api.linkedin.com/v1/companies/' + id + '/shares', {json: options}, cb)(this.config);
};

this.update = function (id, update_id, cb) {
this.createCall('GET', 'companies/' + id + '/updates/key=' + update_id, cb)(this.config);
};
return this;
}.bind(this);
Expand Down

0 comments on commit 076b0b6

Please sign in to comment.