lib/comment_creator.rb
# Generates my comment. Begins by grabbing the parent_id and video_id from the params.
Generates my comment. Begins by grabbing the parent_id and video_id from the params.
Generates my comment . Begins by grabbing the parent_id and video_id from the params .
def generate_comment
    video_id = @info.partition('&lc=').first
    @parent_id = @info.partition('&lc=').last.partition('.').first
    comment_snippet = create_comment_snippet
    response = client.insert_comment('snippet', comment_snippet).to_json
    comment_id = JSON.parse(response).fetch('id')
    external_id = "#{video_id}&lc=#{comment_id}"
    {
      "external_id": external_id,
      "allow_channelback": true
    }.to_json
  end
def generate_comment video_id = @info . partition ( '&lc=' ) . first @parent_id = @info . partition ( '&lc=' ) . last . partition ( '.' ) . first comment_snippet = create_comment_snippet response = client . insert_comment ( 'snippet' , comment_snippet ) . to_json comment_id = JSON . parse ( response ) . fetch ( 'id' ) external_id = "#{video_id}&lc=#{comment_id}" { "external_id" : external_id , "allow_channelback" : true } . to_json end
Generates my comment.
Generates my comment .