Skip to content

Commit e784038

Browse files
committed
Provide proper README
1 parent 8309bef commit e784038

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PaperMetadata
22

3-
TODO: Write a gem description
3+
PaperMetadata is a gem that gets a publication's metadata from by accessing the CrossRef OpenURL API.
44

55
## Installation
66

@@ -18,7 +18,25 @@ Or install it yourself as:
1818

1919
## Usage
2020

21-
TODO: Write usage instructions here
21+
You must first configure PaperMetadata with your CrossRef API username (which you can obtain here ![http://www.crossref.org/requestaccount/](http://www.crossref.org/requestaccount/)):
22+
23+
PaperMetadata.doi_username = '[email protected]'
24+
25+
You can then access API:
26+
27+
result = PaperMetadata.metadata_for('doi:10.1021/ac1014832')
28+
29+
The result will be a hash similar to this one:
30+
31+
{ :volume=>"82",
32+
:isssue=>"19",
33+
:first_page=>"8153",
34+
:last_page=>"8160",
35+
:title=>
36+
"Basic Modeling Approach To Optimize Elemental Imaging by Laser Ablation ICPMS",
37+
:authors=>"Jure Triglav, Johannes T. van Elteren, Vid S. Šelih",
38+
:journal=>"Anal. Chem. 2010",
39+
:resource=>"http://pubs.acs.org/doi/abs/10.1021/ac1014832" }
2240

2341
## Contributing
2442

@@ -27,3 +45,5 @@ TODO: Write usage instructions here
2745
3. Commit your changes (`git commit -am 'Add some feature'`)
2846
4. Push to the branch (`git push origin my-new-feature`)
2947
5. Create new Pull Request
48+
49+
Be sure to run the specs too.

test/test_paper_metadata.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_doi_parsing
1010
to_return(:body => doi_response, :status => 200, :headers => { 'Content-Length' => doi_response.length } )
1111

1212
PaperMetadata.doi_username = '[email protected]'
13+
1314
assert_equal "Basic Modeling Approach To Optimize Elemental Imaging by Laser Ablation ICPMS",
1415
PaperMetadata.metadata_for('doi:10.1021/ac1014832')[:title]
1516
end

0 commit comments

Comments
 (0)