cro - 1.0.2
Introduction
A ruby gem to integrate with the Irish Companies Registration Office's API. You can register for an API account with the CRO via their signup page
Basic Usage
Install the gem
gem install cro
Configure your API details:
CRO::Config.email = "Your email address"
CRO::Config.api_key = "Your API key"
Search for a company
You can then search on companies with
CRO::API.new.search("Company Name", search_type)
The different search_types are:
1 = Exact match (will give very few results usually)
2 = Starts with this phrase (default)
3 = Contains this phrase (slowest, but more results)
This will then return an array of results which you can access for example:
@results = CRO::API.new.search("Starbucks", 3)
@results.each do |result|
puts result["company_name"]
end
# Results
# STARBUCKS COFFEE COMPANY (IRELAND) LIMITED
# STARBUCKS COFFEE CORPORATION LIMITED
# STARBUCKS COFFEE SHOPS LIMITED
Search for a company's official submissions
You can also search on company submissions for offical documents. The company type is defined as "c" for company or "b" for business with the CRO.
CRO::API.new.submissions("company_number", "company_type")
An example of which:
@submissions = CRO::API.new.submissions("397373", "c")
@submissions.each do |submission|
puts submission["sub_type_desc"]
end
-> B10 CHANGE IN DIRECTOR OR SECRETARY
-> B5 RETURN OF ALLOTMENTS
-> G2- OR INCREASE IN NOMINAL SHARE
-> G2- OR INCREASE IN NOMINAL SHARE
-> G2- OR INCREASE IN NOMINAL SHARE
These all currently return json results from the response.
View a submission in detail
You can view more details about any one submission with:
@submission = CRO::API.new.get_submission("6191121", "2")
puts @submission["scan_date"]
-> "2008-11-01T08:54:43Z"
Contributing to cro
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
License
Built by MiniCorp. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.