|
1 | 1 | (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; |
3 | 3 |
|
4 | 4 | fs = require('fs'); |
5 | 5 |
|
|
112 | 112 | }; |
113 | 113 |
|
114 | 114 | 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]; |
117 | 117 | u = url.parse(this.options.base); |
118 | 118 | return addr.then((function(_this) { |
119 | 119 | return function(cb_url) { |
|
321 | 321 | }; |
322 | 322 |
|
323 | 323 | Feedly.prototype.counts = function(autorefresh, newerThan, streamId, cb) { |
324 | | - var found, input, _ref, _ref1, _ref2; |
| 324 | + var found, input, ref, ref1, ref2; |
325 | 325 | 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]; |
327 | 327 | } 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]; |
329 | 329 | } 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]; |
331 | 331 | } |
332 | 332 | input = {}; |
333 | 333 | found = false; |
|
372 | 372 | }; |
373 | 373 |
|
374 | 374 | Feedly.prototype.markFeedRead = function(ids, since, cb) { |
375 | | - var body, _ref; |
| 375 | + var body, ref; |
376 | 376 | if (typeof ids === 'string') { |
377 | 377 | ids = [ids]; |
378 | 378 | } |
379 | 379 | if (typeof since === 'function') { |
380 | | - _ref = [since, null], cb = _ref[0], since = _ref[1]; |
| 380 | + ref = [since, null], cb = ref[0], since = ref[1]; |
381 | 381 | } |
382 | 382 | body = { |
383 | 383 | feedIds: ids, |
|
393 | 393 | }; |
394 | 394 |
|
395 | 395 | Feedly.prototype.markCategoryRead = function(ids, since, cb) { |
396 | | - var _ref; |
| 396 | + var ref; |
397 | 397 | if (typeof ids === 'string') { |
398 | 398 | ids = [ids]; |
399 | 399 | } |
400 | 400 | if (typeof since === 'function') { |
401 | | - _ref = [since, null], cb = _ref[0], since = _ref[1]; |
| 401 | + ref = [since, null], cb = ref[0], since = ref[1]; |
402 | 402 | } |
403 | 403 | return this.ready.then((function(_this) { |
404 | 404 | return function() { |
|
419 | 419 | }; |
420 | 420 |
|
421 | 421 | Feedly.prototype.reads = function(newerThan, cb) { |
422 | | - var input, _ref; |
| 422 | + var input, ref; |
423 | 423 | if (typeof newerThan === 'function') { |
424 | | - _ref = [newerThan, null], cb = _ref[0], newerThan = _ref[1]; |
| 424 | + ref = [newerThan, null], cb = ref[0], newerThan = ref[1]; |
425 | 425 | } |
426 | 426 | input = null; |
427 | 427 | if (newerThan != null) { |
|
433 | 433 | }; |
434 | 434 |
|
435 | 435 | Feedly.prototype.tags = function(newerThan, cb) { |
436 | | - var input, _ref; |
| 436 | + var input, ref; |
437 | 437 | if (typeof newerThan === 'function') { |
438 | | - _ref = [newerThan, null], cb = _ref[0], newerThan = _ref[1]; |
| 438 | + ref = [newerThan, null], cb = ref[0], newerThan = ref[1]; |
439 | 439 | } |
440 | 440 | input = null; |
441 | 441 | if (newerThan != null) { |
|
491 | 491 | }; |
492 | 492 |
|
493 | 493 | Feedly.prototype.stream = function(id, continuation, cb) { |
494 | | - var input, _ref; |
| 494 | + var input, ref; |
495 | 495 | if (typeof continuation === 'function') { |
496 | | - _ref = [continuation, null], cb = _ref[0], continuation = _ref[1]; |
| 496 | + ref = [continuation, null], cb = ref[0], continuation = ref[1]; |
497 | 497 | } |
498 | 498 | input = {}; |
499 | 499 | if (continuation != null) { |
|
516 | 516 | }; |
517 | 517 |
|
518 | 518 | Feedly.prototype.subscribe = function(url, categories, cb) { |
519 | | - var input, _ref; |
| 519 | + var input, ref; |
520 | 520 | if (!url.match(/^feed\//)) { |
521 | 521 | url = "feed/" + url; |
522 | 522 | } |
523 | 523 | if (typeof categories === 'function') { |
524 | | - _ref = [categories, null], cb = _ref[0], categories = _ref[1]; |
| 524 | + ref = [categories, null], cb = ref[0], categories = ref[1]; |
525 | 525 | } |
526 | 526 | input = { |
527 | 527 | id: url |
|
537 | 537 | categories = categories.map(function(c) { |
538 | 538 | var id, m, name; |
539 | 539 | if (typeof c === 'string') { |
540 | | - m = c.match(/^user\/[^/]+\/(.*)/); |
| 540 | + m = c.match(/^user\/[^\/]+\/(.*)/); |
541 | 541 | name = null; |
542 | 542 | id = null; |
543 | 543 | if (!m) { |
|
628 | 628 | })(this)); |
629 | 629 | }; |
630 | 630 |
|
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 | | - |
660 | 631 | return Feedly; |
661 | 632 |
|
662 | 633 | })(); |
|
0 commit comments