Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Fetch data or code associated with a figshare DOI
<?php
// metadata: curl -L -H 'Accept: application/citeproc+json' 'http://dx.doi.org/10.6084/m9.figshare.963557'
$doc = new DOMDocument;
$doc->loadHTMLFile('http://dx.doi.org/10.6084/m9.figshare.963557');
$xpath = new DOMXPath($doc);
$url = $xpath->query('//div[@id="download_all"]/a')->item(0)->getAttribute('href');
exec(sprintf('wget %s', escapeshellarg($url)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment