Module: Feedlr::Gateway::Markers

Included in:
Client
Defined in:
lib/feedlr/gateway/markers.rb

Overview

Markers API

Instance Method Summary collapse

Instance Method Details

#lastest_tagged_entries(options = {}) ⇒ Feedlr::Base

Get the latest tagged entry ids

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :newerThan (String)

    timestamp in ms. Default is 30 days.

Returns:

See Also:



190
191
192
# File 'lib/feedlr/gateway/markers.rb', line 190

def lastest_tagged_entries(options = {})
  build_object(:get , '/markers/tags' , options)
end

#mark_article_as_read(article_id) ⇒ Feedlr::Success

Mark an articles as read

Parameters:

  • article_id (String)

Returns:

See Also:



27
28
29
# File 'lib/feedlr/gateway/markers.rb', line 27

def mark_article_as_read(article_id)
  mark_articles_as_read([article_id])
end

#mark_article_as_unread(article_id) ⇒ Feedlr::Success

Keep an article as unread

Parameters:

  • article_id (String)

Returns:

See Also:



49
50
51
# File 'lib/feedlr/gateway/markers.rb', line 49

def mark_article_as_unread(article_id)
  mark_articles_as_unread([article_id])
end

#mark_articles_as_read(articles_ids) ⇒ Feedlr::Success

Mark multiple articles as read



36
37
38
39
40
41
42
# File 'lib/feedlr/gateway/markers.rb', line 36

def mark_articles_as_read(articles_ids)
  build_object(:post , '/markers' ,
               entryIds: articles_ids ,
               action: 'markAsRead' ,
               type: 'entries'
               )
end

#mark_articles_as_unread(articles_ids) ⇒ Feedlr::Success

Keep multiple articles as unread



58
59
60
61
62
63
64
# File 'lib/feedlr/gateway/markers.rb', line 58

def mark_articles_as_unread(articles_ids)
  build_object(:post , '/markers' ,
               entryIds: articles_ids ,
               action: 'keepUnread' ,
               type: 'entries'
               )
end

#mark_categories_as_read(categories_ids, options) ⇒ Feedlr::Success

Mark categories as read

Parameters:

  • categories_ids (Array)
  • options (Hash)

Options Hash (options):

  • :lastReadEntryId (String)
  • :asOf (String)

    timestamp

Returns:

See Also:



116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/feedlr/gateway/markers.rb', line 116

def mark_categories_as_read(categories_ids, options)
  fail(ArgumentError) unless options[:lastReadEntryId] || options[:asOf]

  opts =  {
    categoryIds: categories_ids ,
    action: 'markAsRead' ,
    type: 'categories'
  }
  opts[:lastReadEntryId] =
    options[:lastReadEntryId] if options[:lastReadEntryId]
  opts[:asOf] = options[:asOf] if options[:asOf]
  build_object(:post , '/markers' , opts)
end

#mark_category_as_read(category_id, options) ⇒ Feedlr::Success

Mark a category as read

Parameters:

  • category_id (String)
  • options (Hash)

Returns:

See Also:



104
105
106
# File 'lib/feedlr/gateway/markers.rb', line 104

def mark_category_as_read(category_id , options)
  mark_categories_as_read([category_id] , options)
end

#mark_feed_as_read(feed_id, options) ⇒ Feedlr::Success

Mark feeds as read

Parameters:

  • feed_id (String)
  • options (Hash)

Returns:

See Also:



72
73
74
# File 'lib/feedlr/gateway/markers.rb', line 72

def mark_feed_as_read(feed_id , options)
  mark_feeds_as_read([feed_id] , options)
end

#mark_feeds_as_read(feeds_ids, options) ⇒ Feedlr::Success

Mark feeds as read

Parameters:

  • feeds_ids (Array)
  • options (Hash)

Options Hash (options):

  • :lastReadEntryId (String)
  • :asOf (String)

    timestamp

Returns:

See Also:



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/feedlr/gateway/markers.rb', line 84

def mark_feeds_as_read(feeds_ids, options)
  fail(ArgumentError) unless options[:lastReadEntryId] || options[:asOf]

  opts =  {
    feedIds: feeds_ids ,
    action: 'markAsRead' ,
    type: 'feeds'
  }
  opts[:lastReadEntryId] =
    options[:lastReadEntryId] if options[:lastReadEntryId]
  opts[:asOf] = options[:asOf] if options[:asOf]
  build_object(:post , '/markers' , opts)
end

#sync_read_counts(options = {}) ⇒ Feedlr::Base

Get the latest read operations (to sync local cache)

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :newerThan (String)

    timestamp in ms. Default is 30 days.

Returns:

See Also:



180
181
182
# File 'lib/feedlr/gateway/markers.rb', line 180

def sync_read_counts(options = {})
  build_object(:get , '/markers/reads' , options)
end

#undo_mark_categories_as_read(categories_ids) ⇒ Feedlr::Success

Undo mark categories as read

Parameters:

  • categories_ids (Array)

Returns:

See Also:



166
167
168
169
170
171
172
# File 'lib/feedlr/gateway/markers.rb', line 166

def undo_mark_categories_as_read(categories_ids)
  build_object(:post , '/markers',
               categoryIds: categories_ids,
               action: 'undoMarkAsRead',
               type: 'categories'
               )
end

#undo_mark_category_as_read(category_id) ⇒ Feedlr::Success

Undo Mark a category as read

Parameters:

  • category_id (String)

Returns:

See Also:



157
158
159
# File 'lib/feedlr/gateway/markers.rb', line 157

def undo_mark_category_as_read(category_id)
  undo_mark_categories_as_read([category_id])
end

#undo_mark_feed_as_read(feed_id) ⇒ Feedlr::Success

Undo mark a feed as read

Parameters:

  • feed_id (String)

Returns:

See Also:



135
136
137
# File 'lib/feedlr/gateway/markers.rb', line 135

def undo_mark_feed_as_read(feed_id)
  undo_mark_feeds_as_read([feed_id])
end

#undo_mark_feeds_as_read(feeds_ids) ⇒ Feedlr::Success

Undo mark feeds as read

Parameters:

  • feeds_ids (Array)

Returns:

See Also:



144
145
146
147
148
149
150
# File 'lib/feedlr/gateway/markers.rb', line 144

def undo_mark_feeds_as_read(feeds_ids)
  build_object(:post , '/markers',
               feedIds: feeds_ids ,
               action: 'undoMarkAsRead' ,
               type: 'feeds'
               )
end

#user_unread_counts(options = {}) ⇒ Feedlr::Base

Get the list of unread counts

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :autorefresh (String)

    let's the server know if this is a background auto-refresh or not

  • :newerThan (String)

    timestamp in ms. Default is 30 days.

  • :streamId (String)

    A user or system category can be passed to restrict the unread count response to feeds in this category

Returns:

See Also:



18
19
20
# File 'lib/feedlr/gateway/markers.rb', line 18

def user_unread_counts(options = {})
  build_object(:get , '/markers/counts' , options)
end