require 'net/http'
require 'time'

def gen_url(i)
  day = Time.now + i*60*60*24
  
  
  old_tz = ENV['TZ']
  ENV['TZ'] = 'Europe/Berlin'
  url = day.strftime('http:
  ENV['TZ'] = old_tz
  url
end

def main
  back = 10
  needle = ARGV[0]
  (-back..0).each do |i|
    url = gen_url(i)
    haystack = Net::HTTP.get(URI(url)).split()
    mentions = haystack.select { |x| x.include? needle }
    if!mentions.empty?
      puts \n
    end
  end
end

main