Module: Vk::DSL::Newsfeed

Included in:
Vk::DSL
Defined in:
lib/vk/dsl/newsfeed.rb

Defined Under Namespace

Classes: SearchItem, SearchResult

Constant Summary collapse

FIELDS =
%i(
  sex bdate city country photo_50 photo_100 photo_200_orig photo_200 photo_400_orig photo_max photo_max_orig
  online online_mobile domain has_mobile contacts connections site education universities schools
  can_post can_see_all_posts can_see_audio can_write_private_message status last_seen common_count
  relation relatives screen_name maiden_name timezone occupation activities interests music movies tv books games
  about quotes
)

Instance Method Summary collapse

Instance Method Details

#search(options = {}) ⇒ SearchResult

Friends information

Parameters:

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

Options Hash (options):

  • :q (String)

    search query string

  • :extended (Boolean)

    search query string

  • :count (Fixnum) — default: 1000

    how many posts to request

  • :latitude (Numeric)

    -90 to 90

  • :longitude (Numeric)

    -180 to 180

  • :start_time (DateTime)
  • :end_time (DateTime)
  • :start_from (String)
  • :fields (Array<Symbol>)

    see FIELDS

Returns:



128
129
130
131
132
133
134
# File 'lib/vk/dsl/newsfeed.rb', line 128

def search(options = {})
  options[:extended] = !!options[:extended] ? 1 : 0 if options[:extended]
  options[:start_time] = options[:start_time].to_i if options[:start_time]
  options[:end_time] = options[:end_time].to_i if options[:end_time]
  options[:fields] = Array.wrap(options[:fields]).compact.join(',') if options[:fields]
  SearchResult.new(self, options).fetch!
end