#pubssite README
Note: This version is in development and this README is intended as a reference for project contributors
- Add/parse a citation
- Retrieve one or more citations by their IDs
- Retrieve citations by their owner
- Retrieve citations by their collection
Parse a citation
URL: http://nupubs.cogs.indiana.edu/citation/parse
Method: POST
Input: A plaintext string in the body of the request
Output: A JSON object representing the newly created citation
Notes: Our project currently is using the excellent
Anystyle parser. We're still training it and working to
improve its accuracy.
Retrieve one or more citations by their IDs
URL: http://nupubs.cogs.indiana.edu/citation/[IDs] Method:
GET`
Input: A citation ID or a list of citation IDs delimited by commas. e.g.
http://nupubs.cogs.indiana.edu/citation/456
http://nupubs.cogs.indiana.edu/citation/456,452,4204
Output: A single JSON-encoded citation or a list of JSON-encoded citations
Retrieve a list of citations belonging to a given user
URL: http://nupubs.cogs.indiana.edu/citation/owner/[owner]
Method: GET
Input: String representing a nupubs user. e.g.
http://nupubs.cogs.indiana.edu/citation/owner/pjcraig
Output: A list containing JSON-encoded citations belonging to the nupubs user
Retrieve a list of citations belonging to a given collection
URL: http://nupubs.cogs.indiana.edu/collection/citations/[collection ID]
Method: GET
Input: A collection's ID. e.g.
http://nupubs.cogs.indiana.edu/collection/citations/345
Output: A JSON-encoded representation of the collection
Retrieve a collection by its collection id
URL: http://nupubs.cogs.indiana.edu/collection/[collection ID]
Method: GET
Input: A collection's ID. e.g.
http://nupubs.cogs.indiana.edu/collection/345
Output: A JSON-encoded representation of the collection
Retrieve a list of collections belonging to a given user
URL: http://nupubs.cogs.indiana.edu/collection/owner/[owner]
Method: GET
Input: A nupubs user. e.g.
http://nupubs.cogs.indiana.edu/collection/owner/pjcraig
Output: A list of JSON-encoded collections
- Download and install MySQL Community Server 5.5:
- Debian/Ubuntu:
sudo apt-get install mysql-server-5.5 libmysqlclient-dev
- Debian/Ubuntu:
- Download a database mirror (contact Jaimie).
- Import the database using the MySQL 5.5 Command Line Client (run
mysql
at a terminal or use the desktop shortcut):CREATE DATABASE pubs; USE pubs; source pubs.backup.sql
- Install the Anaconda Python 2.7 Distribution.
- Open a terminal and run
git clone git@github.com:iucogs/pubssite.git
- In the terminal run
cd pubssite
to access the folder. python setup.py develop
will install the package and all dependencies.
- Open the repository folder.
- Copy
pubs.ini.template
topubs.ini
- Edit the
pubs.ini
template file:- Change the directive
url = ...
tourl = mysql://user:password@localhost:3306/pubs?charset=utf8&use_unicode=1
.- Note: Replace
user
andpassword
with your mysql username (i.e.,root
) and password.
- Note: Replace
- Change the directive
- Install Ruby:
- Windows: RubyInstaller, then follow the directions for installing the "Development Kit", which has download links on the left column under the Ruby downloads.
- Ubuntu/Debian:
sudo apt-get install ruby-dev build-essential
- Install anystyle from terminal:
gem install --user-install anystyle-parser
- If the user-install complains about not being in the
PATH
, then follow the directions at the Ruby Gems site
From the repository directory, run pserve development.ini
.
Open a browser and go to http://localhost:6543/ to see the website running.