Class: Feedly
Defined in: | src/feedly.coffee |
Overview
Talk to the Feedly API.
All methods will ensure a valid authentication dance has occurred, and perform the dance if necessary.
All of the methods that take a callback also return a Q promise - the callback is therefore optional.
WARNING: by default, this class stores state information such as your access token in ~/.feedly by default.
Instance Method Summary
- # (promise(String)) refresh(cb) Refresh the auth token manually.
- # (promise()) logout(cb) Discard all tokens
- # (promise(Array(Category))) categories(cb) Fetch the list of categories
- # (promise()) setCategoryLabel(id, label, cb) Set the label for a category.
- # (promise()) deleteCategory(id, cb) Delete a category.
- # (promise(Entry) or promise(Array(Entry))) entry(id, cb) Get one or more entries
- # (promise()) createEntry(entry, cb) Create an entry.
- # (promise(Feed)) feed(id, cb) Get meta-data about a feed or list of feeds
- # (promise(Counts)) counts(autorefresh, newerThan, streamId, cb) Get unread counts.
- # (void) markEntryRead(ids, cb) Mark articles as read.
- # (void) markEntryUnread(ids, cb) Mark articles as unread.
- # (void) markFeedRead(ids, since, cb) Mark feed(s) as read.
- # (void) markCategoryRead(ids, since, cb) Mark category(s) as read.
- # (promise(Reads)) reads(newerThan, cb) Get the latest read operations (to sync local cache).
- # (promise(Tags)) tags(newerThan, cb) Get the latest tagged entry ids
- # (promise(Prefs)) preferences(cb) Get the current user's preferences
- # (promise(Prefs)) updatePreferences(prefs, cb) Update the preferences of the user
- # (promise(Profile)) profile(cb) Get the current user's profile
- # (promise(Profile)) updateProfile(profile, cb) Update the profile of the user
- # (promise(Array(Feeds))) searchFeeds(query, results = 20, cb) Find feeds based on title, url or #topic
- # (promise(Shortened)) shorten(entry, cb) Create a shortened URL for an entry.
- # (promise(Array(Page))) stream(id, options, cb) Get a list of entry ids for a specific stream.
- # (promise(Array(Page))) contents(id, continuation, cb) Get the content of a stream
- # (promise(Array(Subscription))) subscriptions(cb) Get the user’s subscriptions
- # (promise()) subscribe(url, categories, cb) Subscribe to a feed
- # (promise()) unsubscribe(id, cb) Unsubscribe from a feed
- # (promise()) tagEntry(entry, tags, cb) Tag an existing entry or entries
- # (promise()) setTagLabel(tag, label, cb) Change a tag label
- # (promise()) untagEntries(entries, tags, cb) Untag entries
- # (promise()) deleteTags(tags, cb) Delete tags
Constructor Details
#
(void)
constructor(options)
Instance Method Details
#
(promise(String))
refresh(cb)
Refresh the auth token manually. If the current refresh token is not valid, authenticate again.
#
(promise())
logout(cb)
Discard all tokens
#
(promise(Array(Category)))
categories(cb)
Fetch the list of categories
#
(promise())
setCategoryLabel(id, label, cb)
Set the label for a category.
#
(promise())
deleteCategory(id, cb)
Delete a category.
#
(promise(Entry) or promise(Array(Entry)))
entry(id, cb)
Get one or more entries
#
(promise())
createEntry(entry, cb)
Create an entry. Thiss call is useful to inject entries not coming from a feed, into a user’s account. The entries created will only be available through the tag streams of the respective tags passed.
#
(promise(Feed))
feed(id, cb)
Get meta-data about a feed or list of feeds
#
(promise(Counts))
counts(autorefresh, newerThan, streamId, cb)
Get unread counts. In theory, newerThan and streamId can be used to reduce the counts that are returned, but I didn't see evidence of that in practice.
#
(void)
markEntryRead(ids, cb)
Mark articles as read.
#
(void)
markEntryUnread(ids, cb)
Mark articles as unread.
#
(void)
markFeedRead(ids, since, cb)
Mark feed(s) as read.
#
(void)
markCategoryRead(ids, since, cb)
Mark category(s) as read.
#
(promise(Reads))
reads(newerThan, cb)
Get the latest read operations (to sync local cache).
#
(promise(Tags))
tags(newerThan, cb)
Get the latest tagged entry ids
#
(promise(Prefs))
preferences(cb)
Get the current user's preferences
#
(promise(Prefs))
updatePreferences(prefs, cb)
Update the preferences of the user
#
(promise(Profile))
profile(cb)
Get the current user's profile
#
(promise(Profile))
updateProfile(profile, cb)
Update the profile of the user
#
(promise(Array(Feeds)))
searchFeeds(query, results = 20, cb)
Find feeds based on title, url or #topic
#
(promise(Shortened))
shorten(entry, cb)
Create a shortened URL for an entry. The short URL is unique for a given entry id, user and application.
#
(promise(Array(Page)))
stream(id, options, cb)
Get a list of entry ids for a specific stream.
or an object with stream request parameters
#
(promise(Array(Page)))
contents(id, continuation, cb)
Get the content of a stream
#
(promise(Array(Subscription)))
subscriptions(cb)
Get the user’s subscriptions
#
(promise())
subscribe(url, categories, cb)
Subscribe to a feed
#
(promise())
unsubscribe(id, cb)
Unsubscribe from a feed
#
(promise())
tagEntry(entry, tags, cb)
Tag an existing entry or entries
#
(promise())
setTagLabel(tag, label, cb)
Change a tag label
#
(promise())
untagEntries(entries, tags, cb)
Untag entries
#
(promise())
deleteTags(tags, cb)
Delete tags