lib/ayadn/endpoints.rb in ayadn-1.6.0 vs lib/ayadn/endpoints.rb in ayadn-1.7.0
- old
+ new
@@ -54,11 +54,15 @@
@options_list = if options[:count] || options[:since_id]
API.build_query(options)
else
API.build_query({count: Settings.options[:counts][:global]})
end
- "#{@posts_url}stream/global?access_token=#{Settings.user_token}#{@options_list}"
+ if Settings.options[:force]
+ "#{@posts_url}stream/global?#{@options_list}"
+ else
+ "#{@posts_url}stream/global?access_token=#{Settings.user_token}#{@options_list}"
+ end
end
def trending(options)
@options_list = if options[:count] || options[:since_id]
API.build_query(options)
@@ -99,11 +103,15 @@
@options_list = if options[:count]
API.build_query(options)
else
API.build_query({count: Settings.options[:counts][:posts]})
end
- "#{@users_url}#{username}/posts/?access_token=#{Settings.user_token}#{@options_list}"
+ if Settings.options[:force]
+ "#{@users_url}#{username}/posts/?#{@options_list}"
+ else
+ "#{@users_url}#{username}/posts/?access_token=#{Settings.user_token}#{@options_list}"
+ end
end
def whatstarred(username, options)
@options_list = if options[:count]
API.build_query(options)
@@ -246,10 +254,10 @@
def channels(options)
"#{@channels_url}?access_token=#{Settings.user_token}#{API.build_query(options)}"
end
- def messages(channel_id, options)
+ def messages(channel_id, options = {})
"#{@channels_url}#{channel_id}/messages?access_token=#{Settings.user_token}#{API.build_query(options)}&include_machine=1"
end
def ayadnlog
"#{@channels_url}47348/messages?access_token=#{Settings.user_token}"