A tool and companion service used to:
- find RRIDs in articles
- look them up in the SciCrunch resolver
- create Hypothesis annotations that anchor to the RRIDs and display lookup results
- Create the Hypothesis account under which annotations will be created
- Generate an api token at https://hypothes.is/profile/developer
- Specify HOST, PORT, API TOKEN, and USERNAME
- python rrid.py
- note and install missing libraries
- python rrid.py
Visit http://HOST:PORT/bookmarklet which produces this page:
To install the bookmarklet, drag this link -- rrid -- to your bookmarks bar.
If you need to copy/paste the bookmarklet's code into a bookmarklet, it's here:
javascript:(function(){var xhr=new XMLHttpRequest();var params='uri='+location.href+'&data='+encodeURIComponent(document.body.innerText);xhr.open('POST','http://localhost:8080/rrid',true);xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');xhr.setRequestHeader('Access-Control-Allow-Origin','*');xhr.onreadystatechange=function(){if(xhr.readyState==4)console.log('rrids: '+xhr.responseText)};xhr.send(params)}());
Visit an article that contains RRIDs, click the bookmarklet
The found RRIDs are logged to the JavaScript console
The found RRIDs are logged to timestamped files, along with the text of the article that was scanned for RRIDs
- ssh in to the host that will serve the script
sudo yum install gcc libxml2 libxml2-devel libxslt libxslt-devel python34 python34-devel python34-pip
sudo alternatives --set python /usr/bin/python3.4
sudo pip install requests pyramid lxml
- clone this repository
- change host and port for external http access
export RRIDBOT_USERNAME=someusername
export RRIDBOT_GROUP=somegroupname
unset HISTFILE
export RRIDBOT_API_TOKEN=sometoken
- create a screen session
- in the screen session run
sudo -E ~/scibot/rrid.py
in the folder where you want to save the log files (-E preserves the environment variables)
Use export.py to dump a spreadsheet of RRIDs mined from the data. In the folder for this git repository run the following commands.
export RRIDBOT_USERNAME=someusername
export RRIDBOT_GROUP=somegroupname
unset HISTFILE
export RRIDBOT_API_TOKEN=sometoken
python export.py