lib/ayadn/endpoints.rb in ayadn-1.2.7 vs lib/ayadn/endpoints.rb in ayadn-1.2.8
- old
+ new
@@ -161,9 +161,41 @@
@options_list = API.build_query({count: Settings.options[:counts][:search]})
end
"#{@posts_url}search?text=#{words}&access_token=#{Settings.user_token}#{@options_list}"
end
+ def search_users words, options
+ if options[:count]
+ @options_list = API.build_query(options)
+ else
+ @options_list = API.build_query({count: Settings.options[:counts][:search]})
+ end
+ "#{@users_url}search?q=#{words}&access_token=#{Settings.user_token}#{@options_list}"
+ end
+
+ def search_annotations anno, options
+ if options[:count]
+ @options_list = API.build_query(options)
+ else
+ @options_list = API.build_query({count: Settings.options[:counts][:search]})
+ end
+ "#{@posts_url}search?annotation_types=#{anno}&access_token=#{Settings.user_token}#{@options_list}"
+ end
+
+ def search_messages channel_id, words, options
+ if options[:count]
+ @options_list = API.build_query(options)
+ else
+ @options_list = API.build_query({count: Settings.options[:counts][:search]})
+ end
+ "#{@channels_url}messages/search?query=#{words}&channel_ids=#{channel_id}&access_token=#{Settings.user_token}#{@options_list}"
+ end
+
+ def search_channels words, options
+ @options_list = API.build_query({count: Settings.options[:counts][:search]})
+ "#{@channels_url}search?q=#{words}&order=popularity&access_token=#{Settings.user_token}#{@options_list}"
+ end
+
def user(username)
"#{@users_url}#{username}?access_token=#{Settings.user_token}&include_user_annotations=1"
end
def single_post(post_id, options)