module Instapaper::API::Highlights
Defines methods related to highlights
Public Instance Methods
add_highlight(bookmark_id, options = {})
click to toggle source
Create a new highlight @note Non-subscribers are limited to 5 highlights per month. @param bookmark_id [String, Integer] @param options [Hash] @option options [String] :text The text for the highlight (HTML tags in text parameter should be unescaped.) @option options [String, Integer] :posiiton The 0-indexed position of text in the content. Defaults to 0. @return [Instapaper::Highlight]
# File lib/instapaper/api/highlights.rb, line 20 def add_highlight(bookmark_id, options = {}) perform_post_with_object("/api/1.1/bookmarks/#{bookmark_id}/highlight", options, Instapaper::Highlight) end
delete_highlight(highlight_id, options = {})
click to toggle source
Delete a highlight @param highlight_id [String, Integer] @return [Boolean]
# File lib/instapaper/api/highlights.rb, line 27 def delete_highlight(highlight_id, options = {}) perform_post_with_unparsed_response("/api/1.1/highlights/#{highlight_id}/delete", options) true end
highlights(bookmark_id)
click to toggle source
List highlights for a bookmark @param bookmark_id [String, Integer]
# File lib/instapaper/api/highlights.rb, line 9 def highlights(bookmark_id) perform_get_with_objects("/api/1.1/bookmarks/#{bookmark_id}/highlights", {}, Instapaper::Highlight) end