Skip to content

Commit

Permalink
Slightly surprised this worked, TBH
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Mar 3, 2015
1 parent ca312e0 commit 91e8240
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions lib/purdie/bernard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,24 @@ def source_file path
end

def fetch
flickr = Purdie::Services::Flickr.new @config
soundcloud = Purdie::Services::SoundCloud.new @config
vimeo = Purdie::Services::Vimeo.new @config
services = {}
@config['services'].each do |s|
services[s[0].downcase.to_sym] = "Purdie::Services::#{s[0]}".constantize.new(@config)
end

@sources.each do |source|
File.readlines(source).each do |line|
print "Processing #{line.strip}... "
case line
when /soundcloud/
soundcloud.ingest line

when /flickr/
flickr.ingest line
next if line[0] == '#'

when /vimeo/
vimeo.ingest line
end
print "Processing #{line.strip}... "
services[services.keys.select{ |s| line =~ /#{s.to_s}/ }[0]].ingest line
puts 'done'
end
end

flickr.write
soundcloud.write
vimeo.write
services.each_key do |k|
services[k].write
end
end
end
end

0 comments on commit 91e8240

Please sign in to comment.