Sha256: 2c250f880cc0470f90a589222a5d146de3353b171758fe1c2f04764cd53a4072

Contents?: true

Size: 436 Bytes

Versions: 1

Compression:

Stored size: 436 Bytes

Contents

def pull_image(template_id, line1, line2)
  username = ENV.fetch('IMGFLIP_USERNAME', 'redacted')
  password = ENV.fetch('IMGFLIP_USERNAME', 'redacted')

  api_url = 'https://api.imgflip.com/caption_image'
  result = http.post api_url, {
    template_id: template_id,
    username: username,
    password: password,
    text0: line1,
    text1: line2
  }

  # clean me up
  image = JSON.parse(result.body).fetch("data").fetch("url")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lita-imgflip-memes-1.1.2 examples/003_pull_image.rb