Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit 5d7af9e

Browse files
committed
Update dependencies, re-test, remove defunct topics API
1 parent b127e37 commit 5d7af9e

File tree

7 files changed

+53
-120
lines changed

7 files changed

+53
-120
lines changed

Gruntfile.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,10 @@ module.exports = (grunt) ->
7171
"clean"
7272
"coffee"
7373
"codo"
74-
"markedman"
7574
]
7675
grunt.registerTask "doc", [
7776
"clean:doc"
7877
"codo"
79-
"clean:man"
80-
"markedman"
8178
]
8279
grunt.registerTask "test", [
8380
"coffee"

lib/BufferStream.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function() {
22
var BufferStream, EMPTY, assert, createEOF, stream, util,
3-
__hasProp = {}.hasOwnProperty,
4-
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
5-
__slice = [].slice;
3+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4+
hasProp = {}.hasOwnProperty,
5+
slice = [].slice;
66

77
assert = require('assert');
88

@@ -19,19 +19,19 @@
1919
return e;
2020
};
2121

22-
BufferStream = (function(_super) {
23-
__extends(BufferStream, _super);
22+
BufferStream = (function(superClass) {
23+
extend(BufferStream, superClass);
2424

2525
function BufferStream(options) {
26-
var buf, startEnded, _ref, _ref1, _ref2;
26+
var buf, ref, ref1, ref2, startEnded;
2727
if (options == null) {
2828
options = {};
2929
}
3030
this.clear();
3131
this._resetCB();
3232
BufferStream.__super__.constructor.call(this, options);
33-
this.growSize = (_ref = options.bsGrowSize) != null ? _ref : 512;
34-
this.zero = (_ref1 = options.bsZero) != null ? _ref1 : false;
33+
this.growSize = (ref = options.bsGrowSize) != null ? ref : 512;
34+
this.zero = (ref1 = options.bsZero) != null ? ref1 : false;
3535
this.on("finish", (function(_this) {
3636
return function() {
3737
return _this._resetCB(createEOF());
@@ -40,7 +40,7 @@
4040
buf = options.bsInit;
4141
if (Buffer.isBuffer(buf)) {
4242
this.append(buf);
43-
startEnded = (_ref2 = options.bsStartEnded) != null ? _ref2 : true;
43+
startEnded = (ref2 = options.bsStartEnded) != null ? ref2 : true;
4444
if (!!startEnded) {
4545
this.end();
4646
}
@@ -86,9 +86,9 @@
8686
};
8787

8888
BufferStream.prototype._resetCB = function() {
89-
var args, cb, _ref;
90-
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
91-
_ref = [this.waitingCB, null, Number.MAX_VALUE], cb = _ref[0], this.waitingCB = _ref[1], this.waitingLen = _ref[2];
89+
var args, cb, ref;
90+
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
91+
ref = [this.waitingCB, null, Number.MAX_VALUE], cb = ref[0], this.waitingCB = ref[1], this.waitingLen = ref[2];
9292
if (cb && args.length) {
9393
cb.apply(this, args);
9494
}

lib/feedly.js

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function() {
2-
var Feedly, fs, http, open, path, q, request, untildify, url, utils, _normalizeTag;
2+
var Feedly, _normalizeTag, fs, http, open, path, q, request, untildify, url, utils;
33

44
fs = require('fs');
55

@@ -112,8 +112,8 @@
112112
};
113113

114114
Feedly.prototype._auth = function() {
115-
var addr, result, u, _ref;
116-
_ref = utils.qserver(this.options.port, this.options.html_text), addr = _ref[0], result = _ref[1];
115+
var addr, ref, result, u;
116+
ref = utils.qserver(this.options.port, this.options.html_text), addr = ref[0], result = ref[1];
117117
u = url.parse(this.options.base);
118118
return addr.then((function(_this) {
119119
return function(cb_url) {
@@ -321,13 +321,13 @@
321321
};
322322

323323
Feedly.prototype.counts = function(autorefresh, newerThan, streamId, cb) {
324-
var found, input, _ref, _ref1, _ref2;
324+
var found, input, ref, ref1, ref2;
325325
if (typeof autorefresh === 'function') {
326-
_ref = [autorefresh, null, null, null], cb = _ref[0], autorefresh = _ref[1], newerThan = _ref[2], streamId = _ref[3];
326+
ref = [autorefresh, null, null, null], cb = ref[0], autorefresh = ref[1], newerThan = ref[2], streamId = ref[3];
327327
} else if (typeof newerThan === 'function') {
328-
_ref1 = [newerThan, null, null], cb = _ref1[0], newerThan = _ref1[1], streamId = _ref1[2];
328+
ref1 = [newerThan, null, null], cb = ref1[0], newerThan = ref1[1], streamId = ref1[2];
329329
} else if (typeof streamId === 'function') {
330-
_ref2 = [streamId, null], cb = _ref2[0], streamId = _ref2[1];
330+
ref2 = [streamId, null], cb = ref2[0], streamId = ref2[1];
331331
}
332332
input = {};
333333
found = false;
@@ -372,12 +372,12 @@
372372
};
373373

374374
Feedly.prototype.markFeedRead = function(ids, since, cb) {
375-
var body, _ref;
375+
var body, ref;
376376
if (typeof ids === 'string') {
377377
ids = [ids];
378378
}
379379
if (typeof since === 'function') {
380-
_ref = [since, null], cb = _ref[0], since = _ref[1];
380+
ref = [since, null], cb = ref[0], since = ref[1];
381381
}
382382
body = {
383383
feedIds: ids,
@@ -393,12 +393,12 @@
393393
};
394394

395395
Feedly.prototype.markCategoryRead = function(ids, since, cb) {
396-
var _ref;
396+
var ref;
397397
if (typeof ids === 'string') {
398398
ids = [ids];
399399
}
400400
if (typeof since === 'function') {
401-
_ref = [since, null], cb = _ref[0], since = _ref[1];
401+
ref = [since, null], cb = ref[0], since = ref[1];
402402
}
403403
return this.ready.then((function(_this) {
404404
return function() {
@@ -419,9 +419,9 @@
419419
};
420420

421421
Feedly.prototype.reads = function(newerThan, cb) {
422-
var input, _ref;
422+
var input, ref;
423423
if (typeof newerThan === 'function') {
424-
_ref = [newerThan, null], cb = _ref[0], newerThan = _ref[1];
424+
ref = [newerThan, null], cb = ref[0], newerThan = ref[1];
425425
}
426426
input = null;
427427
if (newerThan != null) {
@@ -433,9 +433,9 @@
433433
};
434434

435435
Feedly.prototype.tags = function(newerThan, cb) {
436-
var input, _ref;
436+
var input, ref;
437437
if (typeof newerThan === 'function') {
438-
_ref = [newerThan, null], cb = _ref[0], newerThan = _ref[1];
438+
ref = [newerThan, null], cb = ref[0], newerThan = ref[1];
439439
}
440440
input = null;
441441
if (newerThan != null) {
@@ -491,9 +491,9 @@
491491
};
492492

493493
Feedly.prototype.stream = function(id, continuation, cb) {
494-
var input, _ref;
494+
var input, ref;
495495
if (typeof continuation === 'function') {
496-
_ref = [continuation, null], cb = _ref[0], continuation = _ref[1];
496+
ref = [continuation, null], cb = ref[0], continuation = ref[1];
497497
}
498498
input = {};
499499
if (continuation != null) {
@@ -516,12 +516,12 @@
516516
};
517517

518518
Feedly.prototype.subscribe = function(url, categories, cb) {
519-
var input, _ref;
519+
var input, ref;
520520
if (!url.match(/^feed\//)) {
521521
url = "feed/" + url;
522522
}
523523
if (typeof categories === 'function') {
524-
_ref = [categories, null], cb = _ref[0], categories = _ref[1];
524+
ref = [categories, null], cb = ref[0], categories = ref[1];
525525
}
526526
input = {
527527
id: url
@@ -537,7 +537,7 @@
537537
categories = categories.map(function(c) {
538538
var id, m, name;
539539
if (typeof c === 'string') {
540-
m = c.match(/^user\/[^/]+\/(.*)/);
540+
m = c.match(/^user\/[^\/]+\/(.*)/);
541541
name = null;
542542
id = null;
543543
if (!m) {
@@ -628,35 +628,6 @@
628628
})(this));
629629
};
630630

631-
Feedly.prototype.topics = function(cb) {
632-
return this._request(cb, '/v3/topics');
633-
};
634-
635-
Feedly.prototype.addTopic = function(topic, interest, cb) {
636-
return this.ready.then((function(_this) {
637-
return function() {
638-
if (!topic.match(/^user\//)) {
639-
topic = "user/" + _this.state.id + "/topic/" + topic;
640-
}
641-
return _this._request(cb, '/v3/topics', 'POST', {
642-
id: topic,
643-
interest: interest
644-
});
645-
};
646-
})(this));
647-
};
648-
649-
Feedly.prototype.deleteTopic = function(topic, cb) {
650-
return this.ready.then((function(_this) {
651-
return function() {
652-
if (!topic.match(/^user\//)) {
653-
topic = "user/" + _this.state.id + "/topic/" + topic;
654-
}
655-
return _this._request(cb, "/v3/topics/" + (encodeURIComponent(topic)), 'DELETE');
656-
};
657-
})(this));
658-
};
659-
660631
return Feedly;
661632

662633
})();

lib/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function() {
22
var BufferStream, http, q, request, url,
3-
__slice = [].slice;
3+
slice = [].slice;
44

55
http = require('http');
66

@@ -13,13 +13,13 @@
1313
BufferStream = require('./BufferStream');
1414

1515
exports.extend = function() {
16-
var a, adds, k, old, v, _i, _len;
17-
old = arguments[0], adds = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
16+
var a, adds, j, k, len, old, v;
17+
old = arguments[0], adds = 2 <= arguments.length ? slice.call(arguments, 1) : [];
1818
if (old == null) {
1919
old = {};
2020
}
21-
for (_i = 0, _len = adds.length; _i < _len; _i++) {
22-
a = adds[_i];
21+
for (j = 0, len = adds.length; j < len; j++) {
22+
a = adds[j];
2323
for (k in a) {
2424
v = a[k];
2525
old[k] = v;

package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,25 @@
2727
},
2828
"homepage": "https://github.com/hildjj/node-feedly",
2929
"devDependencies": {
30-
"grunt": "^0.4.4",
31-
"grunt-codo": "^0.1.0",
32-
"grunt-coffeelint": "0.0.10",
33-
"grunt-contrib-clean": "^0.5.0",
34-
"grunt-contrib-coffee": "^0.10.1",
35-
"grunt-contrib-nodeunit": "^0.3.3",
30+
"coffee-script": "^1.9.2",
31+
"coffeelint": "^1.9.6",
32+
"grunt": "^0.4.5",
33+
"grunt-codo": "^0.2.0",
34+
"grunt-coffeelint": "0.0.13",
35+
"grunt-contrib-clean": "^0.6.0",
36+
"grunt-contrib-coffee": "^0.13.0",
37+
"grunt-contrib-nodeunit": "^0.4.1",
3638
"grunt-contrib-watch": "^0.6.1",
37-
"grunt-express": "^1.2.1",
38-
"grunt-release": "^0.7.0",
39-
"grunt-shell": "^0.7.0",
40-
"jit-grunt": "^0.5.0"
39+
"grunt-express": "^1.4.1",
40+
"grunt-release": "^0.12.0",
41+
"grunt-shell": "^1.1.2",
42+
"jit-grunt": "^0.9.1",
43+
"nodeunit": "^0.9.1"
4144
},
4245
"dependencies": {
4346
"open": "0.0.5",
44-
"q": "^1.0.1",
45-
"request": "^2.34.0",
46-
"untildify": "^0.1.0"
47+
"q": "^1.4.0",
48+
"request": "^2.55.0",
49+
"untildify": "^2.0.0"
4750
}
4851
}

src/feedly.coffee

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -653,35 +653,3 @@ module.exports = class Feedly
653653
tags = [tags]
654654
tags = @_normalizeTags tags
655655
@_request cb, "/v3/tags/#{tags.join(',')}", 'DELETE'
656-
657-
# List all topics
658-
#
659-
# @param cb [function(error, Array(Topic))] Optional callback
660-
# @return [promise(Array(Topic))]
661-
topics: (cb) ->
662-
@_request cb, '/v3/topics'
663-
664-
# Add a topic
665-
#
666-
# @param topic [string] the topic in which to express interest
667-
# @param interest [string] "high", "medium", or "low"
668-
# @param cb [function(error)] Optional callback
669-
# @return [promise()]
670-
addTopic: (topic, interest, cb) ->
671-
@ready.then () =>
672-
if !topic.match(/^user\//)
673-
topic = "user/#{@state.id}/topic/#{topic}"
674-
@_request cb, '/v3/topics', 'POST',
675-
id: topic
676-
interest: interest
677-
678-
# Remove a topic
679-
#
680-
# @param topic [string] the topic in which to express interest
681-
# @param cb [function(error)] Optional callback
682-
# @return [promise()]
683-
deleteTopic: (topic, cb) ->
684-
@ready.then () =>
685-
if !topic.match(/^user\//)
686-
topic = "user/#{@state.id}/topic/#{topic}"
687-
@_request cb, "/v3/topics/#{encodeURIComponent(topic)}", 'DELETE'

test/feedly.test.coffee

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,6 @@ module.exports =
120120
.then (reads) ->
121121
test.ok reads
122122
test.ok Array.isArray(reads.entries)
123-
f.addTopic 'music', 'medium'
124-
.then ->
125-
f.topics()
126-
.then (topics) ->
127-
test.ok Array.isArray(topics)
128-
f.deleteTopic 'music'
129123
.then ->
130124
f.searchFeeds 'arduino'
131125
.then (results) ->

0 commit comments

Comments
 (0)