1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/usr/bin/ruby load "company.rb" load "person.rb" # Get argument (company permalink) input = ARGV[0] company = Crunchbase_Company.new(input) people = company.people # Iterate the people hash people.each do |name, title| # Get the person record person = Crunchbase_Person.new( name ) # Emit the name and title print "#{person.fname} #{person.lname} | #{title}\n" end people = nil company = nil |
1 2 3 4 5 | $ ./people.rb emulex Jim McCluney | President and CEO Michael J. Rockenbach | Executive Vice President and CFO Jeff Benck | Executive Vice President & COO $ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/bin/ruby load "crunchbase.rb" input = ARGV[0] puts "Executive Relationships to " + input company = Crunchbase_Company.new(input) people = company.people # Iterate through everyone associated with this company people.each do |name, title| # Search for only certain titles if title.upcase.include?("CEO") or title.upcase.include?("COO") or title.upcase.include?("CFO") or title.upcase.include?("CHIEF") or title.upcase.include?("CTO") then person = Crunchbase_Person.new( name ) companies = person.companies companies.each do | firm | if input != firm puts " " + firm end end end end |
1 2 3 4 5 6 7 8 9 10 11 12 13 | $ ./influence.rb cloudera Executive Relationships to cloudera accel-partners bittorrent mochimedia yume lookout scalextreme vivasmart yahoo rock-health $ |
1 2 3 4 5 6 7 8 9 10 11 12 13 | http = Net::HTTP.new("site url") # Delete a resource transaction = Net::HTTP:elete.new("resource") response = http.request(transaction) # Post a resource resp, data = Net::HTTP.post_form( url, post_arguments ) # Put a resource transaction = Net::HTTP:ut.new("resource") transaction.set_form_data( "form data..." ) response = http.request(transaction) |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |