Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions lib/feedly.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions src/feedly.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,22 @@ module.exports = class Feedly
# Get the content of a stream
#
# @param id [string] the id of the stream
# @param continuation [string] a continuation id is used to page
# @param options [string|object] a continuation id is used to page
# or an object with stream request parameters
# @param cb [function(error, Array(Page))] Optional callback
# @return [promise(Array(Page))]
contents: (id, continuation, cb) ->
input = {}
if continuation?
input.continuation = continuation
@_request cb, "/v3/streams/#{encodeURIComponent(id)}/contents", 'GET', input
contents: (id, options, cb) ->
input = switch typeof(options)
when 'function'
cb = options
{}
when 'string'
continuation: options
when 'object'
options
else
{}
@_requestURL cb, "/v3/streams/#{encodeURIComponent(id)}/contents", 'GET', input

# Get the user’s subscriptions
#
Expand Down
4 changes: 4 additions & 0 deletions test/feedly.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ module.exports =
test.ok Array.isArray(contents.items)
test.ok contents.continuation
f.contents FEED, contents.continuation
.then (contents) ->
test.ok contents
test.ok Array.isArray(contents.items)
f.contents FEED, {unreadOnly:true}
.then (contents) ->
test.ok contents
f.markFeedRead FEED
Expand Down