Skip to content
Get citations to journal articles and books
Perl Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Perl
Python
README.rst
example-config

README.rst

Citematic::Get uses EBSCOhost, IDEAS (i.e., RePEc), and CrossRef to get bibliographic data for search terms. In the case of EBSCOhost, it also tries to get full-text URLs. It returns at most one result per invocation, so if you aren't looking for a specific item, you're probably better off with the web interfaces.

The actual output of the get function provided by Citematic::Get is a nested data structure of Citation Style Language 1.0 variables (as specified in the input data schema, except that no id is provided). The included Python module "quickbib" uses citeproc-py to generate bibliographies from CSL data using any CSL style you like (but with special support for APA style). Citematic::QuickBib provides a Perl interface to quickbib, and the Perl script cite provides a handy command-line interface to the whole mess. Finally, Citematic::COinS has a function coins to generate ContextObjects in Spans (COinS) from CSL input data.

Examples

  • $ cite 1983 tversky kahneman

    Tversky, A., & Kahneman, D. (1983). Extensional versus intuitive reasoning: The conjunction fallacy in probability judgment. <i>Psychological Review, 90</i>, 293–315. doi:10.1037/0033-295X.90.4.293

  • $ cite nisbett -t 'telling more than we can know'

    Nisbett, R. E., & Wilson, T. D. (1977). Telling more than we can know: Verbal reports on mental processes. <i>Psychological Review, 84</i>, 231–259. doi:10.1037/0033-295X.84.3.231

  • $ cite 10.1080/00224545.1979.9933632

    Zak, I. (1979). Modal personality of young Jews and Arabs in Israel. <i>Journal of Social Psychology, 109</i>, 3–10. doi:10.1080/00224545.1979.9933632

  • $ cite 'Yates, J. F., Veinott, E. S., & Patalano, A. L. (2003).'

    Yates, J. F., Veinott, E. S., & Patalano, A. L. (2003). Hard decisions, bad decisions: On decision quality and decision aiding. In S. L. Schneider & J. Shanteau (Eds.), <i>Emerging perspectives on judgment and decision research</i> (pp. 1–63). New York, NY: Cambridge University Press.

See cite --help for a description of command-line options. See Perl/test_citematic.pm for more examples of what Citematic::Get can find and Python/test_apa.py for more examples of what quickbib can format.

Installation

  1. Ensure you have the following Perl modules. You can install modules with sudo cpan install WWW::Mechanize or sudo cpanm WWW::Mechanize (using cpanminus) or your package manager.
  • Citematic::Get requires: File::Slurp HTML::Entities HTTP::Cookies JSON LWP::Simple List::Util Text::Aspell URI::Escape WWW::Mechanize XML::Simple parent
  • Citematic::QuickBib requires: IPC::Run JSON
  • Citematic::COinS requires: HTML::Entities URI::Escape
  • cite requires: File::Slurp Getopt::Long::Descriptive
  1. Ensure you have Python 3, then get and install (as by putting it in /usr/lib/python3/dist-packages) citeproc-py and its own dependencies.
  2. Download apa.csl (and, if you'll be running quickbib's one test for it, mla.csl) and set the environment variable APA_CSL_PATH to where you put it (ditto MLA_CSL_PATH).
  3. Copy the example configuration file to $HOME/.citematic and edit it. Registering for CrossRef is easy. Getting access to EBSCOhost is harder. There's a good chance that your school (if you're using Citematic, you must be a student or an academic, right? right?) or your local library has an institutional subscription that you can use from home. You may be able to log in with a single HTTP POST (the Firefox extension Tamper Data is helpful for figuring out how), in which case editing ebsco_login will be particularly easy. And if your IP address is already authenticated, then you don't need to log in at all, and you can set ebsco_login to a no-op like 1. (Perl programmers note that $_ refers to a WWW::Mechanize object in this context.)

Running the tests

For quickbib, enter the Python directory and say py.test. This requires pytest.

For Citematic::Get, say perl test_citematic.pl. This requires Test::More.

Caveats

If you look at the code of Citematic::Get, you'll see that a great many cases need to be covered in order to parse all the idiosyncratic record formats. You'd hope that all that data would be systematically structured, huh? It isn't really, hence regexes. I've done a pretty good job (if I do say so myself) of covering psychology articles (particularly those represented in PsycINFO and PsycARTICLES), but more regexes will no doubt be needed if you plunge further into the depths of, say, MEDLINE. And while I implemented support for IDEAS so I can get economics articles, fields like mathematics and chemistry will probably require more databases. In short, I wrote this program for my own use, so I took pains to support the sort of articles I read (in experimental social psychology and JDM), but the further your interests are from mine, the more work you'd have to do to make Citematic::Get useful. Patches are more than welcome; I would love for Citematic to be as well-rounded in scraping as it is in formatting.

Another thing: every query is cached, but the cache never times out. You'll need to delete the cache file or edit it by hand (or in the case of EBSCO, use the -b option to cite) in order to see any updates to the databases.

Will I get in trouble for using this program?

So far as I can tell from EBSCOhost's terms of use, St. Louis Fed's legal-notices page, and CrossRef's terms and conditions, no. You will notice that Citematic::Get does not use Google Scholar or Scirus, which forbid automated queries.

There may be some restrictions on what you can do with the data you get, which apply just the same as if you'd used the web interface (e.g., EBSCO's terms say something about "non-commercial use"), but given that fair-use laws apply, I doubt you'll have any problems.

And, of course, since this is mostly done with web scraping, server-side changes could suddenly render Citematic::Get inoperable.

Why didn't you use Z39.50?

I couldn't get it to work.

Why did you call it "Sittymatic"?

It's pronounced "CITE-uh", you numskull.

Licenses

Citematic (specifically, quickbib) contains some code, in modified form, from citeproc-py, to which the below two-clause BSD-style license applies. Citematic itself is licensed under the GPL.

License for citeproc-py

Copyright 2011-2012 Brecht Machiels. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the copyright holder.

License for Citematic

Citematic is copyright 2012 Kodi Arfer.

Citematic is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Citematic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Something went wrong with that request. Please try again.