Skip to content

Commit

Permalink
Add the getting of a users favorites.
Browse files Browse the repository at this point in the history
  • Loading branch information
digicyc committed Jun 4, 2015
1 parent 7989d74 commit fff838a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ Twitter.prototype.getHomeTimeline = function (params, error, success) {
this.doRequest(url, error, success);
};

Twitter.prototype.getFavorites = function(params, error, success) {
var path = '/favorites/list.json' + this.buildQS(params);
var url = this.baseUrl + path;
this.doRequest(url, error, success);
};

Twitter.prototype.getReTweetsOfMe = function (params, error, success) {
var path = '/statuses/retweets_of_me.json' + this.buildQS(params);
var url = this.baseUrl + path;
Expand Down
10 changes: 10 additions & 0 deletions test/spec/TwitterITSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ describe('Twitter', function () {
);
});

it('should get favorites', function (done) {
var params = { count: '10'};
twitter.getFavorites(params, error,
function (data) {
expect(JSON.parse(data).length).toEqual(10);
done();
}
);
});

it('should get mentions timeline', function (done) {
var params = { count: '10'};
twitter.getMentionsTimeline(params, error,
Expand Down

0 comments on commit fff838a

Please sign in to comment.