Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Wednesday, 18 July 2012

PLoS Altmetric API will change soon

Just got an email from PLoS ALM Team saying that they are updating their API for their Article Level Metrics (ALM; Altmetric) tools.


The Almetric software shows "citation" data on scientific papers harvested from social networks such as Twitter, Scientific Blogs, Citeulike and Mendeley. They deliver this content via their very easy API.


You could also visit their website http://altmetric.com/ and enter a DOI number for your favorite paper and see how many citations from social network it has. Also you can see the "hot" papers that have the most number of citations so are the one that "everybody" is reading right now.

I am using the altmetric API for my website and noticed that there seems to be a mix up in the data that was harvested for one of our recently published papers:

Peña C, Malm T (2012) VoSeq: A Voucher and DNA Sequence Web Application. PLoS ONE 7: e39071. doi:10.1371/journal.pone.0039071


For some reason Altmetric started to collect data from their announcement when their released Altmetric:


You can see the Altmetric API and changes in their github profile:
https://github.com/articlemetrics/alm/wiki/API

Friday, 18 May 2012

Voucher pages in JSON format

I made a quick addition to our public NSG database. Voucher pages will output the specimen's data in JSON format for easy and automated harvesting of our data.

JSON is becoming a commonly used format for transfer of data over the Internet because it can be easily integrated into Javascript. Nowadays, there are even database systems that keep all data in JSON format (e.g. couchdb, mongodb, etc).

This is how it works in our database:



{
  "institutionCode": "NSG",
  "catalogNumber": "NW85-8",
  "voucher_code": "NW85-8",
  "recordNumber": "NW85-8",
  "family": "Hesperiidae",
  "subfamily": "",
  "tribe": "",
  "subtribe": "",
  "genus": "Achlyodes",
  "specificEpithet": "busiris",
  "infraspecificEpithet": "",
  "country": "PERU",
  "locality": "Km 28, road to Yurimaguas",
  "decimalLatitude": "-6.412590",
  "decimalLongitude": "-76.315900",
  "verbatimElevation": "750m",
  "collector": "St\u00e9phanie Gallusser",
  "eventDate": "2001-11-02",
  "voucherLocality": "NSG coll.",
  "sex": "",
  "voucherImage": "http:\/\/flickr.com\/photos\/37256239@N03\/3429238255\/",
  "associatedSequences": "GQ864726;GQ864820;GQ864414;GQ865378;GQ865050;GQ864915;GQ864593;GQ864507;GQ865158;GQ865279"
}
  • If you use the function getJSON of jQuery to call this web service, you will need to use the field jsoncallback=? or callback=? and, to avoid confusions, the field format=jsonp.
  • Example: Calls the NSG database for data about specimen code NW85-8 using jQuery's function getJSON.
<!DOCTYPE html>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test
</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>


</head>
<body>

<script>
$(document).ready(function() {
       $.getJSON("http://nymphalidae.utu.fi/story.php?callback=?",
            {
                code: "NW85-8",
                format: "jsonp"
            },
        function(data) {
            var output = "";
            output += "voucher code: " + data.voucher_code + "<br />";
            output += "genus: " + data.genus + "<br />";
            output += "species: " + data.specificEpithet + "<br />";

            $("div").html(output);
        });
});

</script>

<div></div>
</body>
</html>

And the output will be:

Tuesday, 28 February 2012

Integration with EOL

Our database now asks EOL for author and year of description for species names. It is using EOL's search API to pull the authority and link to the corresponding species page in EOL. If there is a positive response from EOL the authority and link will appear under the voucher code:



EOL gets the authority information from several sources (including Ubio and GenBank). However their taxonomy is far from complete and needs urgent updates.

Friday, 10 April 2009

Moving to Flickr

Image representing Flickr as depicted in Crunc...Image via CrunchBase

All the voucher pictures in our NSG database take up to 2.5GB in hard disk space, which is quite a lot for 3300 pictures only.

This is indeed a problem if we decide to move the database into a private, commercial server because buying 2.5 GB of space can be quite expensive.

Then Flickr might be able to help. By having a PRO account, users are allowed to upload unlimited number of photos and even retaining the original sizes of high resolution photos, for only 25 USD per year. Quite a bargain indeed.

Since moving more than 3000 pictures can be tiresome, I used used Flickr's API interface and grabbed an API key.

Then I found the PHP class libraries of Phlickr very useful as a layer on top of Flickr's API.

I used Phlickr to harvest information from the NSG database and included it as Title, description and Tags of the photos to be uploaded to Flickr.

Almost everything worked as a charm. However, I found that Phlickr got problems in getting the image URL, by constructing the link using the wrong id of the photo. I had to fix it by hacking the Photo.php class -> function buildImgUrl()

The database then will link to the photo on Flickr:



Now people can comment on every picture and point out whenever we misidentify the vouchers. The possibility of adding notes on top of the photo might of some use.

NSG's photostream in Flickr: http://www.flickr.com/photos/nsg_db/



Reblog this post [with Zemanta]