Rinstapkg (version 0.1.0)

ig_comment: Comment or Delete a Comment on a Post

Description

This function takes the media_id of a post and text for a comment or the id of a comment to manipulate the comment on the post.

Usage

ig_comment(media_id, comment_text, verbose = FALSE)

ig_comment_delete(media_id, comment_id, verbose = FALSE)

Arguments

media_id

numeric; the unique id to identify a post which can be found in the id, not the pk field, of posts returned via many of the functions retrieving feeds.

comment_text

character; the text that would be posted as a comment underneath the post

verbose

logical; do you want informative messages?

comment_id

numeric; the unique id to identify a post which can be found in the "id" on other comments returned via the Instagram API

Examples

Run this code
# NOT RUN {
last_post_media_id <- ig_my_timeline(paginate = FALSE)$id[1]
comment_result <- ig_comment(last_post_media_id, 
                             comment_text = "New Comment!")
comment_media_id <- comment_result$comment$media_id                              
deletion_result <- ig_comment_delete(last_post_media_id, 
                                     comment_media_id)
# }

Run the code above in your browser using DataCamp Workspace