cool seed wip [ci skip]

This commit is contained in:
Maxwell Salzberg 2012-04-24 01:13:29 -07:00
parent fe72c59ff7
commit 6c5dafa6e9
2 changed files with 100 additions and 0 deletions

52
config/cool_people.yml Normal file
View file

@ -0,0 +1,52 @@
writer:
name: "Kevin Koolman"
posts:
- text: '“Marshall McLuhan said that, we look at the present through a rear-view mirror, and we march backwards into the future. Invention becomes our lens to imagine what is possible, and design is the road we follow to reach it. But, there is a snag in McLuhans view, because marching is no way to go into the future. It is too methodical and restricted. The world often subverts our best laid plans, so our road calls for a way to move that is messier, bolder, more responsive. The lightness and joy afforded by creating suggests that we instead dance" - Frank Chimero'
- text: '"Everyone has a photographic memory, some just dont have film."'
- text: "Today lasted forever. But really. Ive been up since 7am walking around and Im too exhausted to do anything but sit in my bed and feast on treasures from today (cheese, blueberries, salami and bread with a bottle of wine this alcohol under 21 thing is pretty great). Amsterdam is a city of canals. I concluded that its also a morning city meaning that everything has a different feel to it in the early hours of the morning. There are swans in the water, birds chirping, ….. people just starting to clean up the trash and mess from last night. Im glad I came here myself. One, because one can really reevaluate all the shadiness and sadness thats around. Red light districts people are buying affection, 50 euros for 20 minutes from girls from Eastern Europe who need cash to support their families and living. They tap on the glass, smile, and wave at you with their barbie-sized proportions and men stand on the opposite end of the streets, eyes flickering from window to window. Coffeeshops are open for business selling pungent goods to keep you entertained for a good five hours and a bit more. The business transactions are so normal on the streets. Thirty minutes, or five hour trips and all every day, every night, but so alluring. This morning I stood in the middle of the main square looking up at the Royal Palace gold and gilded monument symbolizing nothing more than a box with forlorn looking statues gazing from its facade. Commuters were on their way to work. No one looked happy. Trash everywhere. Square was empty except for smoking teenage passerbys in leather jackets walking home from a seedy weekend adventure.Graffiti was the backdrop to their journey. "
- text: 'Time to invent a new future'
photographer:
name: "Polly Photographer"
posts:
- text: 'i was definitely some sort of bird in my past life.'
- text: 'This is not a deer'
photo: ' http://25.media.tumblr.com/tumblr_m2mmzybwEs1qevmz4o1_500.jpg'
- text: 'Sleepless in #Amsterdam'
photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash3/539915_3737052667985_1326174311_33541557_1023742200_n.jpg'
- photo: 'http://24.media.tumblr.com/tumblr_m2w7ynCHct1r2ysm3o1_500.png'
- photo: 'http://28.media.tumblr.com/tumblr_m28j5osnBy1qj69kjo1_1280.jpg'
- photo: ' http://29.media.tumblr.com/tumblr_m2yd1hP3SS1r1m6ayo1_500.jpg'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/33608_1638866977335_1406591038_1724566_8022154_n.jpg'
text: 'hello friend'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/215323_10150153470293170_604243169_6767922_1154482_n.jpg'
text: 'hello, paris'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/216184_10150153469618170_604243169_6767914_442611_n.jpg'
- photo: 'http://scienceblogs.com/startswithabang/upload/2011/07/is_this_where_the_matter_in_th/Virgo-Cluster.jpeg'
- photo: 'http://www.nasa.gov/centers/goddard/images/content/433226main_Misti_ComaCluster.jpg'
- photo: http://apod.nasa.gov/apod/image/0801/M31_hallas.jpg
- photo: http://thearchitectofadventure.files.wordpress.com/2011/11/colourful-universe-desktop3c.jpg
- photo: http://www.mostlyjunkfood.com/treats/2012/04/coachella-2012-stream.jpg
- photo: http://26.media.tumblr.com/tumblr_m28j5a5TAU1r8qarro1_500.jpg
collector:
name: "Charlie Collector"
posts:
- photo: http://25.media.tumblr.com/tumblr_m0qo48UJwI1qh2jkmo1_500.jpg
- video: 'http://www.youtube.com/watch?feature=player_embedded&v=vuxKb5mxM8g'
- photo: http://27.media.tumblr.com/tumblr_m19n02mk1x1qavkb2o1_1280.jpg
- text: @cainsarcade
photo: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/305393_183499138391926_181029958638844_372989_662353677_n.jpg
- photo: http://cuterthanpie.files.wordpress.com/2010/04/100_1386.jpg
- photo: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-prn1/555729_412524702098653_120085081342618_1554312_577289292_n.jpg
- photo: http://picturepoetry.files.wordpress.com/2007/10/achewood-beef-hee-hee.jpg?w=500
- photo: http://www.everydaywithedward.com/img/links/scarygoround.PNG
- photo: http://payload.cargocollective.com/1/0/4707/904187/tumblr_ktw9iioNtU1qa2i2xo1_400_1.gif
- video: http://vimeo.com/34750078
- photo: http://dearada.typepad.com/.a/6a00d8341bf66653ef010536886222970c-pi
- text: '#karlmartens'
photo: http://www.harmenliemburg.nl/wp-content/uploads/Karel-Martens-5.jpg
- photo: http://catalogtree.net/pictures/001236image.jpg
- photo: http://catalogtree.net/pictures/000967image.jpg

48
lib/tasks/cool_seed.rake Normal file
View file

@ -0,0 +1,48 @@
desc 'Seeds cool users'
task :cool => :environment do
require 'factory_girl_rails'
cool_people_yml = YAML.load(File.open(File.join(Rails.root, 'config', 'cool_people.yml')))
cool_people_yml.each do |name, attributes|
puts "making #{name}"
user = make_user_with_name(attributes['name'])
attributes['posts'].shuffle.each do |post|
new_post = Factory.build(:status_message, :public => true, :text => '', :author => user.person)
new_post.text = post.fetch('text', '')
if p = post['photo']
new_photo = Factory.build(:photo)
new_photo.processed_image_url = p
new_photo.save
new_photo.update_remote_path
new_post.photos << new_photo
new_photo.save
end
#wut to do with videos :(
new_post.save
puts "made: #{post}"
end
end
end
def make_user_with_name(name)
first, last = name.split
return user if user = User.find_by_username(first)
person = Factory.build(:person)
person.save!
profile = Factory(:profile, :first_name => first, :last_name => last, :person => person)
user = Factory.build(:user, :username => first)
user.person = person
person.save!
person.profile.destroy
person.profile = profile
profile.person_id = person.id
profile.save
user.save
user
end