Class: Vk::API::Wall

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/types.rb,
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/wall/app_post.rb,
lib/vk/api/wall/graffiti.rb,
lib/vk/api/wall/wallpost.rb,
lib/vk/api/wall/post_type.rb,
lib/vk/api/wall/wall_link.rb,
lib/vk/api/wall/link_button.rb,
lib/vk/api/wall/link_rating.rb,
lib/vk/api/wall/methods/get.rb,
lib/vk/api/wall/methods/pin.rb,
lib/vk/api/wall/post_source.rb,
lib/vk/api/wall/link_product.rb,
lib/vk/api/wall/methods/edit.rb,
lib/vk/api/wall/methods/post.rb,
lib/vk/api/wall/posted_photo.rb,
lib/vk/api/wall/wall_comment.rb,
lib/vk/api/wall/attached_note.rb,
lib/vk/api/wall/methods/unpin.rb,
lib/vk/api/wall/wallpost_full.rb,
lib/vk/api/wall/methods/delete.rb,
lib/vk/api/wall/methods/repost.rb,
lib/vk/api/wall/methods/search.rb,
lib/vk/api/wall/wallpost_to_id.rb,
lib/vk/api/wall/methods/restore.rb,
lib/vk/api/wall/methods/get_by_id.rb,
lib/vk/api/wall/wallpost_attached.rb,
lib/vk/api/wall/comment_attachment.rb,
lib/vk/api/wall/methods/get_reposts.rb,
lib/vk/api/wall/methods/report_post.rb,
lib/vk/api/wall/wallpost_attachment.rb,
lib/vk/api/wall/methods/edit_comment.rb,
lib/vk/api/wall/methods/get_comments.rb,
lib/vk/api/wall/methods/create_comment.rb,
lib/vk/api/wall/methods/delete_comment.rb,
lib/vk/api/wall/methods/report_comment.rb,
lib/vk/api/wall/responses/get_response.rb,
lib/vk/api/wall/responses/pin_response.rb,
lib/vk/api/wall/methods/restore_comment.rb,
lib/vk/api/wall/responses/edit_response.rb,
lib/vk/api/wall/responses/post_response.rb,
lib/vk/api/wall/responses/unpin_response.rb,
lib/vk/api/wall/responses/delete_response.rb,
lib/vk/api/wall/responses/repost_response.rb,
lib/vk/api/wall/responses/search_response.rb,
lib/vk/api/wall/responses/restore_response.rb,
lib/vk/api/wall/responses/get_by_id_response.rb,
lib/vk/api/wall/responses/get_reposts_response.rb,
lib/vk/api/wall/responses/report_post_response.rb,
lib/vk/api/wall/responses/edit_comment_response.rb,
lib/vk/api/wall/responses/get_comments_response.rb,
lib/vk/api/wall/responses/create_comment_response.rb,
lib/vk/api/wall/responses/delete_comment_response.rb,
lib/vk/api/wall/responses/report_comment_response.rb,
lib/vk/api/wall/responses/restore_comment_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: AppPost, AttachedNote, CommentAttachment, Graffiti, LinkButton, LinkProduct, LinkRating, PostSource, PostedPhoto, WallComment, WallLink, Wallpost, WallpostAttached, WallpostAttachment, WallpostFull, WallpostToId

Constant Summary collapse

PostType =

Post type

API::Types::Coercible::String.enum('post', 'copy', 'reply', 'postpone', 'suggest')

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

#create_comment(arguments = {}) ⇒ Vk::API::Wall::Responses::CreateCommentResponse

Returns Adds a comment to a post on a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

  • :from_group (Boolean)

    '1' — to post the comment as from the community;; '0' — (default) to post the comment as from the user.

  • :message (String) — default: Required if 'attachments' is not set.

    Text of the comment.

  • :reply_to_comment (Integer)

    ID of comment to reply.

  • :attachments (Array) — default: Required if 'message' is not set.

    List of media objects attached to the comment, in the following format:; ","; '' — Type of media ojbect:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner.; '' — Media ID. ; ; For example:; "photo100172_166443618,photo66748_265827614"

  • :sticker_id (Integer)

    Sticker ID.

  • :guid (String)

    Unique identifier to avoid repeated comments.

Returns:

See Also:



446
447
448
449
450
451
452
# File 'lib/vk/api/methods.rb', line 446

def create_comment(arguments = {})
  require "vk/api/wall/methods/create_comment"
  method = Methods::CreateComment.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/create_comment_response"
  Responses::CreateCommentResponse.new(response.deep_symbolize_keys)
end

#delete(arguments = {}) ⇒ Vk::API::Wall::Responses::DeleteResponse

Returns Deletes a post from a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    ID of the post to be deleted.

Returns:

See Also:



373
374
375
376
377
378
379
# File 'lib/vk/api/methods.rb', line 373

def delete(arguments = {})
  require "vk/api/wall/methods/delete"
  method = Methods::Delete.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/delete_response"
  Responses::DeleteResponse.new(response.deep_symbolize_keys)
end

#delete_comment(arguments = {}) ⇒ Vk::API::Wall::Responses::DeleteCommentResponse

Returns Deletes a comment on a post on a user wall or community wall.;.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.;

  • :comment_id (Integer)

    Comment ID.

Returns:

See Also:



472
473
474
475
476
477
478
# File 'lib/vk/api/methods.rb', line 472

def delete_comment(arguments = {})
  require "vk/api/wall/methods/delete_comment"
  method = Methods::DeleteComment.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/delete_comment_response"
  Responses::DeleteCommentResponse.new(response.deep_symbolize_keys)
end

#edit(arguments = {}) ⇒ Vk::API::Wall::Responses::EditResponse

Returns Edits a post on a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

  • :friends_only (Boolean) — default: Applies only when editing a scheduled post.

    ; '1' — post will be available to friends only; '0' — post will be available to all users (default)

  • :message (String) — default: Required if 'attachments' is not set.

    Text of the post.

  • :attachments (Array) — default: Required if 'message' is not set.

    List of objects attached to the post, in the following format:; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media application owner.; '' — Media application ID. ; ; Example:; "photo100172_166443618,photo66748_265827614"; May contain a link to an external page to include in the post. Example:; "photo66748_265827614,http://habrahabr.ru"; "NOTE: If more than one link is being attached, an error is thrown."

  • :services (String, 'facebook') — default: Applies only to a scheduled post.

    List of services or websites where status will be updated, if the user has so requested. Sample values: 'twitter', 'facebook'.

  • :signed (Boolean) — default: Applies only to a post that was created "as community" on a community wall.

    ; '1' — to add the signature of the user who created the post

  • :publish_date (Integer) — default: Applies only to a scheduled post.

    Publication date (in Unix time). If used, posting will be delayed until the set time.

  • :lat (Number)

    Geographical latitude of the check-in, in degrees (from -90 to 90).

  • :long (Number)

    Geographical longitude of the check-in, in degrees (from -180 to 180).

  • :place_id (Integer)

    ID of the location where the user was tagged.

  • :mark_as_ads (Boolean)

Returns:

See Also:



361
362
363
364
365
366
367
# File 'lib/vk/api/methods.rb', line 361

def edit(arguments = {})
  require "vk/api/wall/methods/edit"
  method = Methods::Edit.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/edit_response"
  Responses::EditResponse.new(response.deep_symbolize_keys)
end

#edit_comment(arguments = {}) ⇒ Vk::API::Wall::Responses::EditCommentResponse

Returns Edits a comment on a user wall or community wall.;.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.; ;

  • :comment_id (Integer)

    Comment ID.

  • :message (String)

    New comment text.;

  • :attachments (Array)

    List of objects attached to the comment, in the following format:; ; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media attachment owner.; '' — Media attachment ID. ; ; For example:; "photo100172_166443618,photo66748_265827614"

Returns:

See Also:



460
461
462
463
464
465
466
# File 'lib/vk/api/methods.rb', line 460

def edit_comment(arguments = {})
  require "vk/api/wall/methods/edit_comment"
  method = Methods::EditComment.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/edit_comment_response"
  Responses::EditCommentResponse.new(response.deep_symbolize_keys)
end

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

Returns a list of posts on a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID.

  • :domain (String)

    User or community short address.

  • :offset (Integer)

    Offset needed to return a specific subset of posts.

  • :count (Integer)

    Number of posts to return (maximum 100).

  • :filter (String)

    Filter to apply:; 'owner' — posts by the wall owner; 'others' — posts by someone else; 'all' — posts by the wall owner and others (default); 'postponed' — timed posts (only available for calls with an 'access_token'); 'suggests' — suggested posts on a community wall

  • :extended (Boolean)

    '1' — to return 'wall', 'profiles', and 'groups' fields; '0' — to return no additional fields (default)

  • :fields (Array)

Returns:

See Also:



256
257
258
259
260
261
262
# File 'lib/vk/api/methods.rb', line 256

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

#get_by_id(arguments = {}) ⇒ Vk::API::Wall::Responses::GetByIdResponse

Returns a list of posts from user or community walls by their IDs.

Parameters:

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

Options Hash (arguments):

  • :posts (Array)

    User or community IDs and post IDs, separated by underscores. Use a negative value to designate a community ID. Example:; "93388_21539,93388_20904,2943_4276,-1_1"

  • :extended (Boolean)

    '1' — to return user and community objects needed to display posts; '0' — no additional fields are returned (default)

  • :copy_history_depth (Integer) — default: 2

    Sets the number of parent elements to include in the array 'copy_history' that is returned if the post is a repost from another wall.

  • :fields (Array)

Returns:

See Also:



287
288
289
290
291
292
293
# File 'lib/vk/api/methods.rb', line 287

def get_by_id(arguments = {})
  require "vk/api/wall/methods/get_by_id"
  method = Methods::GetById.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/get_by_id_response"
  Responses::GetByIdResponse.new(response.deep_symbolize_keys)
end

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

Returns a list of comments on a post on a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

  • :need_likes (Boolean)

    '1' — to return the 'likes' field; '0' — not to return the 'likes' field (default)

  • :start_comment_id (Integer)
  • :offset (Integer)

    Offset needed to return a specific subset of comments.

  • :count (Integer)

    Number of comments to return (maximum 100).

  • :sort (String)

    Sort order:; 'asc' — chronological; 'desc' — reverse chronological

  • :preview_length (Integer)

    Number of characters at which to truncate comments when previewed. By default, '90'. Specify '0' if you do not want to truncate comments.;

  • :extended (Boolean)

Returns:

See Also:



428
429
430
431
432
433
434
# File 'lib/vk/api/methods.rb', line 428

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

#get_reposts(arguments = {}) ⇒ Vk::API::Wall::Responses::GetRepostsResponse

Returns information about reposts of a post on user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. By default, current user ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

  • :offset (Integer)

    Offset needed to return a specific subset of reposts.

  • :count (Integer) — default: 20

    Number of reposts to return.

Returns:

See Also:



339
340
341
342
343
344
345
# File 'lib/vk/api/methods.rb', line 339

def get_reposts(arguments = {})
  require "vk/api/wall/methods/get_reposts"
  method = Methods::GetReposts.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/get_reposts_response"
  Responses::GetRepostsResponse.new(response.deep_symbolize_keys)
end

#pin(arguments = {}) ⇒ Vk::API::Wall::Responses::PinResponse

Returns Pins the post on wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

Returns:

See Also:



397
398
399
400
401
402
403
# File 'lib/vk/api/methods.rb', line 397

def pin(arguments = {})
  require "vk/api/wall/methods/pin"
  method = Methods::Pin.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/pin_response"
  Responses::PinResponse.new(response.deep_symbolize_keys)
end

#post(arguments = {}) ⇒ Vk::API::Wall::Responses::PostResponse

Returns Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :friends_only (Boolean)

    '1' — post will be available to friends only; '0' — post will be available to all users (default)

  • :from_group (Boolean)

    For a community:; '1' — post will be published by the community; '0' — post will be published by the user (default)

  • :message (String) — default: Required if 'attachments' is not set.

    Text of the post.

  • :attachments (Array) — default: Required if 'message' is not set.

    List of objects attached to the post, in the following format:; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; 'page' — wiki-page; 'note' — note; 'poll' — poll; 'album' — photo album; '' — ID of the media application owner. ; '' — Media application ID.; ; Example:; "photo100172_166443618,photo66748_265827614"; May contain a link to an external page to include in the post. Example:; "photo66748_265827614,http://habrahabr.ru"; "NOTE: If more than one link is being attached, an error will be thrown."

  • :services (String, 'facebook')

    List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'.

  • :signed (Boolean)

    Only for posts in communities with 'from_group' set to '1':; '1' — post will be signed with the name of the posting user; '0' — post will not be signed (default)

  • :publish_date (Integer)

    Publication date (in Unix time). If used, posting will be delayed until the set time.

  • :lat (Number)

    Geographical latitude of a check-in, in degrees (from -90 to 90).

  • :long (Number)

    Geographical longitude of a check-in, in degrees (from -180 to 180).

  • :place_id (Integer)

    ID of the location where the user was tagged.

  • :post_id (Integer)

    Post ID. Used for publishing of scheduled and suggested posts.

  • :guid (String)
  • :mark_as_ads (Boolean) — default: false

Returns:

See Also:



311
312
313
314
315
316
317
# File 'lib/vk/api/methods.rb', line 311

def post(arguments = {})
  require "vk/api/wall/methods/post"
  method = Methods::Post.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/post_response"
  Responses::PostResponse.new(response.deep_symbolize_keys)
end

#report_comment(arguments = {}) ⇒ Vk::API::Wall::Responses::ReportCommentResponse

Returns Reports (submits a complaint about) a comment on a post on a user wall or community wall.;.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the wall.

  • :comment_id (Integer)

    Comment ID.

  • :reason (Integer)

    Reason for the complaint:; '0' – spam; '1' – child pornography; '2' – extremism; '3' – violence; '4' – drug propaganda; '5' – adult material; '6' – insult; abuse

Returns:

See Also:



510
511
512
513
514
515
516
# File 'lib/vk/api/methods.rb', line 510

def report_comment(arguments = {})
  require "vk/api/wall/methods/report_comment"
  method = Methods::ReportComment.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/report_comment_response"
  Responses::ReportCommentResponse.new(response.deep_symbolize_keys)
end

#report_post(arguments = {}) ⇒ Vk::API::Wall::Responses::ReportPostResponse

Returns Reports (submits a complaint about) a post on a user wall or community wall.;.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the wall.

  • :post_id (Integer)

    Post ID.

  • :reason (Integer)

    Reason for the complaint:; '0' – spam; '1' – child pornography; '2' – extremism; '3' – violence; '4' – drug propaganda; '5' – adult material; '6' – insult; abuse

Returns:

See Also:



497
498
499
500
501
502
503
# File 'lib/vk/api/methods.rb', line 497

def report_post(arguments = {})
  require "vk/api/wall/methods/report_post"
  method = Methods::ReportPost.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/report_post_response"
  Responses::ReportPostResponse.new(response.deep_symbolize_keys)
end

#repost(arguments = {}) ⇒ Vk::API::Wall::Responses::RepostResponse

Returns Reposts (copies) an object to a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :object (String)

    ID of the object to be reposted on the wall. Example:; "wall66748_3675"

  • :message (String)

    Comment to be added along with the reposted object.

  • :group_id (Integer)

    Target community ID when reposting to a community.

  • :mark_as_ads (Boolean) — default: false

Returns:

See Also:



325
326
327
328
329
330
331
# File 'lib/vk/api/methods.rb', line 325

def repost(arguments = {})
  require "vk/api/wall/methods/repost"
  method = Methods::Repost.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/repost_response"
  Responses::RepostResponse.new(response.deep_symbolize_keys)
end

#restore(arguments = {}) ⇒ Vk::API::Wall::Responses::RestoreResponse

Returns Restores a post deleted from a user wall or community wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID from whose wall the post was deleted. Use a negative value to designate a community ID.

  • :post_id (Integer)

    ID of the post to be restored.

Returns:

See Also:



385
386
387
388
389
390
391
# File 'lib/vk/api/methods.rb', line 385

def restore(arguments = {})
  require "vk/api/wall/methods/restore"
  method = Methods::Restore.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/restore_response"
  Responses::RestoreResponse.new(response.deep_symbolize_keys)
end

#restore_comment(arguments = {}) ⇒ Vk::API::Wall::Responses::RestoreCommentResponse

Returns Restores a comment deleted from a user wall or community wall.;.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :comment_id (Integer)

    Comment ID.

Returns:

See Also:



484
485
486
487
488
489
490
# File 'lib/vk/api/methods.rb', line 484

def restore_comment(arguments = {})
  require "vk/api/wall/methods/restore_comment"
  method = Methods::RestoreComment.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/restore_comment_response"
  Responses::RestoreCommentResponse.new(response.deep_symbolize_keys)
end

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

Returns Allows to search posts on user or community walls.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    user or community id. ; "Remember that for a community 'owner_id' must be negative."

  • :domain (String)

    user or community screen name.

  • :query (String)

    search query string.

  • :owners_only (Boolean)

    '1' – returns only page owner's posts.

  • :count (Integer) — default: 20

    count of posts to return.

  • :extended (Boolean)

    show extended post info.

  • :fields (Array)

Returns:

See Also:



273
274
275
276
277
278
279
# File 'lib/vk/api/methods.rb', line 273

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

#unpin(arguments = {}) ⇒ Vk::API::Wall::Responses::UnpinResponse

Returns Unpins the post on wall.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

Returns:

See Also:



409
410
411
412
413
414
415
# File 'lib/vk/api/methods.rb', line 409

def unpin(arguments = {})
  require "vk/api/wall/methods/unpin"
  method = Methods::Unpin.new(arguments)
  response = method.call(@client)
  require "vk/api/wall/responses/unpin_response"
  Responses::UnpinResponse.new(response.deep_symbolize_keys)
end