lib/twitter_ebooks/bot.rb
# Get an array of media uris in tweet.
# @param size [String] A twitter image size to return. Supported sizes are thumb, small, medium (default), large
# @return [Array<String>] image URIs included in tweet
Get an array of media uris in tweet.
Get an array of media uris in tweet .
def media_uris(size_input = '')
      case size_input
      when 'thumb'
        size = ':thumb'
      when 'small'
        size = ':small'
      when 'medium'
        size = ':medium'
      when 'large'
        size = ':large'
      else
        size = ''
      end
      uris = []
      if @tweet.media?
        @tweet.media.each do |each_media|
          uris << each_media.media_url.to_s + size
        end
      end
      uris
    end
def media_uris ( size_input = '' ) case size_input when 'thumb' size = ':thumb' when 'small' size = ':small' when 'medium' size = ':medium' when 'large' size = ':large' else size = '' end uris = [ ] if @tweet . media? @tweet . media . each do | each_media | uris << each_media . media_url . to_s + size end end uris end
Get an array of media uris in tweet.
Get an array of media uris in tweet .
# Start collecting uris. # and that's pretty much it!
image URIs included in tweet
image URIs included in tweet
Array<String>
size_input
size
A twitter image size to return. Supported sizes are thumb, small, medium (default), large
A twitter image size to return . Supported sizes are thumb small medium ( default ) large