```ruby
require 'sinatra'
require 'flickraw'

def random_pic_url
  FlickRaw.api_key = ENV['FLICKR_API_KEY']
  FlickRaw.shared_secret = ENV['FLICKR_SHARED_SECRET']
  
  user_id = ENV['FLICKR_USER_ID']
  list = flickr.photos.search :user_id => user_id, :tags => ENV['FLICKR_TAG']
  ridx = rand(list.count)
  info = flickr.photos.getInfo :photo_id => list[ridx].id, :secret => list[ridx].secret
  
  FlickRaw.url_z(info)
end

configure do
  mime_type :jpg, 'image/jpeg'
end

get '/' do
  "Meow!"
end

get '/random' do
  random_pic_url
end

get '/randompic' do
  "<img src=\"#{random_pic_url}\">"
end```

Add optional parameters for /random and /randompic to allow specification of arbitrary flickr users and tag
user
```ruby
require 'sinatra'
require 'flickraw'

def random_pic_url(user_id = nil, tag = nil)
  FlickRaw.api_key = ENV['FLICKR_API_KEY']
  FlickRaw.shared_secret = ENV['FLICKR_SHARED_SECRET']
  
  if (user_id == nil)
    user_id = ENV['FLICKR_USER_ID'] 
    tag = ENV['FLICKR_TAG']
  end
  
  begin
    list = flickr.photos.search :user_id => user_id, :tags => tag
  rescue
    list = nil
  end
  
  if (list != nil && list.count != 0)
    ridx = rand(list.count)
    info = flickr.photos.getInfo :photo_id => list[ridx].id, :secret => list[ridx].secret
  
    FlickRaw.url_z(info)
  else
    nil
  end
end

configure do
  mime_type :jpg, 'image/jpeg'
end

get '/' do
  "Meow!"
end

get '/random' do
  url = random_pic_url(params[:user_id], params[:tag])
  if (url)
    url
  else
    [404,"no pics found"]
  end
end

get '/randompic/?:user_id?/?:tag?' do
  url = random_pic_url(params[:user_id], params[:tag])
  if (url)
    "<img src=\"#{url}\">"
  else
    [404,"no pics found"]
  end
end```
assistant