This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ../crossref_processed.json | while read entry | |
do | |
doi=$(echo $entry | jq -r '.doi') | |
echo creating "$doi" | |
mkdir -p "$doi" | |
echo $entry > "$doi/data.json" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you'll need: | |
# - bionode-ncbi (https://github.com/bionode/bionode-ncbi) | |
# - jq (https://github.com/stedolan/jq) | |
# count the number of retracted papers | |
bionode-ncbi search pubmed "\"Retracted Publication\"" \ | |
| jq -c 'select(.pubtype[] | inside("Retracted Publication"))' | |
| wc -l | |
# get DOIs for all the retracted papers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for path in $(find ../articles_split/articles/ -type d -wholename '*\/*\/*\/*\/*' | grep '.\{36\}'); do | |
mergeddir=$(echo $path | sed 's/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)/\1\2\3\4\5/') | |
mkdir -p $mergeddir | |
cp -R $path/* $mergeddir/ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resultbatcher = ds => { | |
let count = 0 | |
const write = (list, cb) => { | |
count += list.length | |
bus.emit('results:receive', { | |
hits: list.map(r => { | |
r.source = ds.key | |
return r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const html = require('choo/html') | |
const css = require('csjs-inject') | |
const C = require('../lib/constants') | |
const style = css` | |
.search { | |
height: 30px; | |
width: 80%; | |
bottom: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for json in $(ls *.json); do | |
splitdir=$(echo $json | sed -e 's/elife-\([0-9]\{5\}\)-v[0-9]\.json/\1/' -e 's/\(.\)/\1\//g') | |
echo moving $json to $splitdir | |
mkdir -p $splitdir | |
mv $json $splitdir/ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get count of fulltext XML papers by license | |
http://api.crossref.org/v1/works?filter=has-full-text:true,full-text.type:text/xml&facet=t | |
# for a given license, get count of publishers, e.g. | |
http://api.crossref.org/v1/works?filter=has-full-text:true,full-text.type:text/xml,license.url:http://creativecommons.org/licenses/by/3.0/&facet=t | |
# for a given license and publisher, get the first 10 papers URLs and download them, e.g. | |
URL = "http://api.crossref.org/v1/works?filter=has-full-text:true,full-text.type:text/xml,license.url:http://creativecommons.org/licenses/by/3.0/,publisher-name:Elsevier BV&rows=10" | |
curl $URL | jq ".message.items[].link[].URL" | grep 'text\/xml' | wget |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hyperdrive = require('hyperdrive') | |
const discover = require('hyperdiscovery') | |
const key = '33fcb3ea86942f913240d3f39c7c68f81fc2bdefc65cb56646d52a62a90bdec9' | |
const drive = hyperdrive('.', '') | |
drive.once('ready', () => { | |
driveswarm = discover(drive) | |
drive.once('content', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dir in $(ls); do | |
splitdir=$(echo $dir | sed -e 's/\(.\)/\1\//g' -e 's/\/$//') | |
echo $dir to $splitdir | |
mkdir -p $splitdir | |
mv $dir/* $splitdir | |
rmdir $dir | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const level = require('level') | |
const hyperdrive = require('hyperdrive') | |
const discover = require('hyperdiscovery') | |
const pages = require('random-access-page-files') | |
const key = '154624e28aabcdf52625769f7b42361b4f7dafe53a14d27035d9ea9878262e16' | |
const drive = hyperdrive(level('./test_pages.hd')) | |
const archive = drive.createArchive( |