Skip to content

Instantly share code, notes, and snippets.

@etozzato
Created September 4, 2010 21:45
Show Gist options
  • Select an option

  • Save etozzato/565518 to your computer and use it in GitHub Desktop.

Select an option

Save etozzato/565518 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
apps = %w(my-audi my-bmw my-ferrari my-ford my-jeep my-landrover my-toyota my-volvo myacura mycadillac mychevrolet mychrysler mydodge mygmc myhonda myhummer myjaguar mylexus mylotus mymaserati mymazda mymercedes-benz mymini mymitsubishi mynissan myporsche myrover mysaab mysmart mysubaru myvolkswagen)
if File.exist?('/home/etozzato/my/logs/feed.id')
feed_id = File.read('/home/etozzato/my/logs/feed.id').to_i
`echo '#{feed_id + 1}' > /home/etozzato/my/logs/feed.id`
if feed_id > webs.size-1
feed_id = 0
`echo '#{feed_id + 1}' > /home/etozzato/my/logs/feed.id`
end
else
feed_id = 0
`echo '#{feed_id + 1}' > /home/etozzato/my/logs/feed.id`
end
puts `export RAILS_ENV=production && cd /home/etozzato/my/#{apps[feed_id]}.us && rake update_feeds`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment