Class: Vk::API::Newsfeed

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/newsfeed/list.rb,
lib/vk/api/newsfeed/item_note.rb,
lib/vk/api/newsfeed/item_audio.rb,
lib/vk/api/newsfeed/item_photo.rb,
lib/vk/api/newsfeed/item_topic.rb,
lib/vk/api/newsfeed/item_video.rb,
lib/vk/api/newsfeed/item_friend.rb,
lib/vk/api/newsfeed/methods/get.rb,
lib/vk/api/newsfeed/item_wallpost.rb,
lib/vk/api/newsfeed/newsfeed_item.rb,
lib/vk/api/newsfeed/item_photo_tag.rb,
lib/vk/api/newsfeed/methods/search.rb,
lib/vk/api/newsfeed/newsfeed_photo.rb,
lib/vk/api/newsfeed/methods/add_ban.rb,
lib/vk/api/newsfeed/methods/get_lists.rb,
lib/vk/api/newsfeed/methods/save_list.rb,
lib/vk/api/newsfeed/methods/delete_ban.rb,
lib/vk/api/newsfeed/methods/get_banned.rb,
lib/vk/api/newsfeed/methods/delete_list.rb,
lib/vk/api/newsfeed/methods/ignore_item.rb,
lib/vk/api/newsfeed/methods/unsubscribe.rb,
lib/vk/api/newsfeed/methods/get_comments.rb,
lib/vk/api/newsfeed/methods/get_mentions.rb,
lib/vk/api/newsfeed/methods/unignore_item.rb,
lib/vk/api/newsfeed/responses/get_response.rb,
lib/vk/api/newsfeed/methods/get_recommended.rb,
lib/vk/api/newsfeed/responses/search_response.rb,
lib/vk/api/newsfeed/responses/add_ban_response.rb,
lib/vk/api/newsfeed/responses/get_lists_response.rb,
lib/vk/api/newsfeed/responses/save_list_response.rb,
lib/vk/api/newsfeed/methods/get_suggested_sources.rb,
lib/vk/api/newsfeed/responses/delete_ban_response.rb,
lib/vk/api/newsfeed/responses/get_banned_response.rb,
lib/vk/api/newsfeed/responses/delete_list_response.rb,
lib/vk/api/newsfeed/responses/ignore_item_response.rb,
lib/vk/api/newsfeed/responses/unsubscribe_response.rb,
lib/vk/api/newsfeed/responses/get_comments_response.rb,
lib/vk/api/newsfeed/responses/get_mentions_response.rb,
lib/vk/api/newsfeed/responses/unignore_item_response.rb,
lib/vk/api/newsfeed/responses/get_recommended_response.rb,
lib/vk/api/newsfeed/responses/get_suggested_sources_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: ItemAudio, ItemFriend, ItemNote, ItemPhoto, ItemPhotoTag, ItemTopic, ItemVideo, ItemWallpost, List, NewsfeedItem, NewsfeedPhoto

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#add_ban(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::AddBanResponse

Returns Prevents news from specified users and communities from appearing in the current user's newsfeed.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



4546
4547
4548
4549
4550
4551
4552
# File 'lib/vk/api/methods.rb', line 4546

def add_ban(arguments = {})
  require "vk/api/newsfeed/methods/add_ban"
  method = Methods::AddBan.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/add_ban_response"
  Responses::AddBanResponse.new(response.deep_symbolize_keys)
end

#delete_ban(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::DeleteBanResponse

Returns Allows news from previously banned users and communities to be shown in the current user's newsfeed.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



4558
4559
4560
4561
4562
4563
4564
# File 'lib/vk/api/methods.rb', line 4558

def delete_ban(arguments = {})
  require "vk/api/newsfeed/methods/delete_ban"
  method = Methods::DeleteBan.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/delete_ban_response"
  Responses::DeleteBanResponse.new(response.deep_symbolize_keys)
end

#delete_list(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::DeleteListResponse



4639
4640
4641
4642
4643
4644
4645
# File 'lib/vk/api/methods.rb', line 4639

def delete_list(arguments = {})
  require "vk/api/newsfeed/methods/delete_list"
  method = Methods::DeleteList.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/delete_list_response"
  Responses::DeleteListResponse.new(response.deep_symbolize_keys)
end

#get(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetResponse

Returns data required to show newsfeed for the current user.

Parameters:

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

Options Hash (arguments):

  • :filters (Array)

    Filters to apply:; 'post' — new wall posts; 'photo' — new photos; 'photo_tag' — new photo tags; 'wall_photo' — new wall photos; 'friend' — new friends; 'note' — new notes

  • :return_banned (Boolean)

    '1' — to return news items from banned sources

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago.

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a news item to return. By default, the current time.

  • :max_photos (Integer)

    Maximum number of photos to return. By default, '5'.

  • :source_ids (String)

    Sources to obtain news from, separated by commas.; ; User IDs can be specified in formats '' or 'u' ; where '' is the user's friend ID.; ; Community IDs can be specified in formats '-' or 'g' ; where '' is the community ID.; ; If the parameter is not set, all of the user's friends and communities are returned, except for banned sources, which can be obtained with the method.;

  • :start_from (String)

    identifier required to get the next page of results. ; Value for this parameter is returned in 'next_from' field in a reply.

  • :count (Integer)

    Number of news items to return (default 50; maximum 100). For auto feed, you can use the 'new_offset' parameter returned by this method.

  • :fields (Array)

    Additional fields of and to return.

Returns:

See Also:



4473
4474
4475
4476
4477
4478
4479
# File 'lib/vk/api/methods.rb', line 4473

def get(arguments = {})
  require "vk/api/newsfeed/methods/get"
  method = Methods::Get.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_response"
  Responses::GetResponse.new(response.deep_symbolize_keys)
end

#get_banned(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetBannedResponse

Returns a list of users and communities banned from the current user's newsfeed.

Parameters:

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

Options Hash (arguments):

  • :extended (Boolean)

    '1' — return extra information about users and communities

  • :fields (Array)

    Profile fields to return.; ;

  • :name_case (String)

    Case for declension of user name and surname:; 'nom' — nominative (default); 'gen' — genitive ; 'dat' — dative; 'acc' — accusative ; 'ins' — instrumental ; 'abl' — prepositional

Returns:

See Also:



4534
4535
4536
4537
4538
4539
4540
# File 'lib/vk/api/methods.rb', line 4534

def get_banned(arguments = {})
  require "vk/api/newsfeed/methods/get_banned"
  method = Methods::GetBanned.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_banned_response"
  Responses::GetBannedResponse.new(response.deep_symbolize_keys)
end

#get_comments(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetCommentsResponse

Returns a list of comments in the current user's newsfeed.

Parameters:

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

Options Hash (arguments):

  • :count (Integer) — default: 30

    Number of comments to return. For auto feed, you can use the 'new_offset' parameter returned by this method.

  • :filters (Array)

    Filters to apply:; 'post' — new comments on wall posts; 'photo' — new comments on photos; 'video' — new comments on videos; 'topic' — new comments on discussions; 'note' — new comments on notes;

  • :reposts (String)

    Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the parameter is set, the 'filters' parameter is optional.);

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours ago.

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a comment to return. By default, the current time.

  • :start_from (String)

    Identificator needed to return the next oage with results. Value for this parameter returns in 'next_from' field.

  • :fields (Array)

    Additional fields of and to return.

Returns:

See Also:



4506
4507
4508
4509
4510
4511
4512
# File 'lib/vk/api/methods.rb', line 4506

def get_comments(arguments = {})
  require "vk/api/newsfeed/methods/get_comments"
  method = Methods::GetComments.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_comments_response"
  Responses::GetCommentsResponse.new(response.deep_symbolize_keys)
end

#get_lists(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetListsResponse

Returns a list of newsfeeds followed by the current user.

Parameters:

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

Options Hash (arguments):

  • :list_ids (Array)

    numeric list identifiers.

Returns:

See Also:



4614
4615
4616
4617
4618
4619
4620
# File 'lib/vk/api/methods.rb', line 4614

def get_lists(arguments = {})
  require "vk/api/newsfeed/methods/get_lists"
  method = Methods::GetLists.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_lists_response"
  Responses::GetListsResponse.new(response.deep_symbolize_keys)
end

#get_mentions(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetMentionsResponse

Returns a list of posts on user walls in which the current user is mentioned.;

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    Owner ID.

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago.;

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a post to return. By default, the current time.;

  • :offset (Integer)

    Offset needed to return a specific subset of posts.

  • :count (Integer) — default: 20

    Number of posts to return.

Returns:

See Also:



4521
4522
4523
4524
4525
4526
4527
# File 'lib/vk/api/methods.rb', line 4521

def get_mentions(arguments = {})
  require "vk/api/newsfeed/methods/get_mentions"
  method = Methods::GetMentions.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_mentions_response"
  Responses::GetMentionsResponse.new(response.deep_symbolize_keys)
end

Returns ; Returns a list of newsfeeds recommended to the current user.

Parameters:

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

Options Hash (arguments):

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago.

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a news item to return. By default, the current time.

  • :max_photos (Integer)

    Maximum number of photos to return. By default, '5'.

  • :start_from (String)

    'new_from' value obtained in previous call.

  • :count (Integer)

    Number of news items to return.

  • :fields (Array)

    Additional fields of and to return.

Returns:

See Also:



4489
4490
4491
4492
4493
4494
4495
# File 'lib/vk/api/methods.rb', line 4489

def get_recommended(arguments = {})
  require "vk/api/newsfeed/methods/get_recommended"
  method = Methods::GetRecommended.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_recommended_response"
  Responses::GetRecommendedResponse.new(response.deep_symbolize_keys)
end

#get_suggested_sources(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::GetSuggestedSourcesResponse

Returns communities and users that current user is suggested to follow.

Parameters:

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

Options Hash (arguments):

  • :offset (Integer)

    offset required to choose a particular subset of communities or users.

  • :count (Integer) — default: 20

    amount of communities or users to return.

  • :shuffle (Boolean)

    shuffle the returned list or not.

  • :fields (Array)

    list of extra fields to be returned. See and .

Returns:

See Also:



4666
4667
4668
4669
4670
4671
4672
# File 'lib/vk/api/methods.rb', line 4666

def get_suggested_sources(arguments = {})
  require "vk/api/newsfeed/methods/get_suggested_sources"
  method = Methods::GetSuggestedSources.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/get_suggested_sources_response"
  Responses::GetSuggestedSourcesResponse.new(response.deep_symbolize_keys)
end

#ignore_item(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::IgnoreItemResponse

Returns Hides an item from the newsfeed.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    Item type. Possible values:; *'wall' – post on the wall;; *'tag' – tag on a photo;; *'profilephoto' – profile photo;; *'video' – video;; *'audio' – audio.

  • :owner_id (Integer)

    Item owner's identifier (user or community); "Note that community id must be negative. ; 'owner_id=1' – user ; 'owner_id=-1' – community "

  • :item_id (Integer)

    Item identifier

Returns:

See Also:



4571
4572
4573
4574
4575
4576
4577
# File 'lib/vk/api/methods.rb', line 4571

def ignore_item(arguments = {})
  require "vk/api/newsfeed/methods/ignore_item"
  method = Methods::IgnoreItem.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/ignore_item_response"
  Responses::IgnoreItemResponse.new(response.deep_symbolize_keys)
end

#save_list(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::SaveListResponse

Returns Creates and edits user newsfeed lists.

Parameters:

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

Options Hash (arguments):

  • :list_id (Integer)

    numeric list identifier (if not sent, will be set automatically).

  • :title (String)

    list name.

  • :source_ids (Array)

    users and communities identifiers to be added to the list. Community identifiers must be negative numbers.

  • :no_reposts (Boolean)

    reposts display on and off ('1' is for off).

Returns:

See Also:



4628
4629
4630
4631
4632
4633
4634
# File 'lib/vk/api/methods.rb', line 4628

def save_list(arguments = {})
  require "vk/api/newsfeed/methods/save_list"
  method = Methods::SaveList.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/save_list_response"
  Responses::SaveListResponse.new(response.deep_symbolize_keys)
end

#search(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::SearchResponse

Returns search results by statuses.;

Parameters:

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

Options Hash (arguments):

  • :q (String)

    Search query string (e.g., 'New Year').

  • :extended (Boolean)

    '1' — to return additional information about the user or community that placed the post.

  • :count (Integer) — default: 30

    Number of posts to return.

  • :latitude (Number)

    Geographical latitude point (in degrees, -90 to 90) within which to search.;

  • :longitude (Number)

    Geographical longitude point (in degrees, -180 to 180) within which to search.;

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago.

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a news item to return. By default, the current time.

  • :start_from (String)
  • :fields (Array)

    Additional fields of and to return.

Returns:

See Also:



4603
4604
4605
4606
4607
4608
4609
# File 'lib/vk/api/methods.rb', line 4603

def search(arguments = {})
  require "vk/api/newsfeed/methods/search"
  method = Methods::Search.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/search_response"
  Responses::SearchResponse.new(response.deep_symbolize_keys)
end

#unignore_item(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::UnignoreItemResponse

Returns a hidden item to the newsfeed.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    Item type. Possible values:; *'wall' – post on the wall;; *'tag' – tag on a photo;; *'profilephoto' – profile photo;; *'video' – video;; *'audio' – audio.

  • :owner_id (Integer)

    Item owner's identifier (user or community); "Note that community id must be negative. ; 'owner_id=1' – user ; 'owner_id=-1' – community "

  • :item_id (Integer)

    Item identifier

Returns:

See Also:



4584
4585
4586
4587
4588
4589
4590
# File 'lib/vk/api/methods.rb', line 4584

def unignore_item(arguments = {})
  require "vk/api/newsfeed/methods/unignore_item"
  method = Methods::UnignoreItem.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/unignore_item_response"
  Responses::UnignoreItemResponse.new(response.deep_symbolize_keys)
end

#unsubscribe(arguments = {}) ⇒ Vk::API::Newsfeed::Responses::UnsubscribeResponse

Returns Unsubscribes the current user from specified newsfeeds.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    Type of object from which to unsubscribe:; 'note' — note; 'photo' — photo; 'post' — post on user wall or community wall; 'topic' — topic; 'video' — video

  • :owner_id (Integer)

    Object owner ID.

  • :item_id (Integer)

    Object ID.

Returns:

See Also:



4652
4653
4654
4655
4656
4657
4658
# File 'lib/vk/api/methods.rb', line 4652

def unsubscribe(arguments = {})
  require "vk/api/newsfeed/methods/unsubscribe"
  method = Methods::Unsubscribe.new(arguments)
  response = method.call(@client)
  require "vk/api/newsfeed/responses/unsubscribe_response"
  Responses::UnsubscribeResponse.new(response.deep_symbolize_keys)
end