
Show HN: One-click citations for your essays - michaelq
http://www.speedcite.com/
======
aaren
For interest, you can do something like this on the command line using curl.
Try these:

    
    
        curl -LH "Accept: text/bibliography" "http://dx.doi.org/10.1017/S0022112061000019"
    
        curl -LH "Accept: text/bibliography; style=bibtex" "http://dx.doi.org/10.1017/S0022112061000019"
    
        curl -LH "Accept: text/bibliography; style=apa" "http://dx.doi.org/10.1017/S0022112061000019"
    
    

My academic life became a lot simpler when I learnt this - now I only need to
maintain a database of {cite key: DOI} pairs, rather than a bibtex monster.
Yes, I have tried Mendeley et al. and yes, I do prefer scripts that do what I
tell them to.

~~~
michaelq
This works great! I looked into doi.org before but I wasn't sure what their
ratelimit is. I'm currently using phantomJS and google scholar for DOIs, and I
think I might have hit their rate limit already, so I will take a second look
at this!

~~~
aaren
p.s. I found I had to use 'data.crossref.org' instead of 'dx.doi.org' when I
scripted it (python + requests). Not sure why exactly (doi was redirecting to
crossref anyway).

~~~
aaren
How to do it in python in case anyone is wondering:

    
    
        import requests
        import json
    
        url = 'http://data.crossref.org/10.1017/S0022112061000019'
        headers = {'Accept': 'application/citeproc+json'}
        r = requests.get(url, headers=headers)
        meta = json.loads(r.content)
        # meta is a dictionary of metadata, e.g. meta['DOI']

~~~
mmcnickle
Neat tip: You can just do:

    
    
        meta = r.json()
    

and avoid the json import.

------
slg
Very cool. This would have saved me tons of time in college.

One minor usability issue, clicking the different style after generating the
citation doesn't have any result until you generate a new citation. That is a
little unintuitive. I would either switch to the different style immediately
or put some separation in the UI between the returned citation and the
components that are used to generate a new citation.

~~~
michaelq
Thanks for the feedback. Originally, clicking the style pill button refreshed
the citation (in the selected style), which I think is the behavior you're
describing. It sounds like I should go back to that behavior.

~~~
agildehaus
Have the server respond with the necessary info but generate the style client
side instead of server side. There doesn't appear to be any need to make trips
back to the server to change styles.

Also, "[http://google.com"](http://google.com") complains about robots.txt,
but "[http://google.com/"](http://google.com/") (trailing slash) does not.

~~~
michaelq
You're right - I could just pass the variables as JS to the client, then
assemble the final citation there. Great idea! Regarding the trailing slash,
that's a regex problem, and I will solve it! Nice catch.

------
bradknowles
Going to the URL for this page
([https://news.ycombinator.com/item?id=7674449](https://news.ycombinator.com/item?id=7674449))
and plugging that into speedcite, I get back truncated information on the
subject line:

The MLA format cite comes out as:

"Show HN: One." Ycombinator.com. N.p. Web. 30 Apr. 2014.
<[https://news.ycombinator.com/>](https://news.ycombinator.com/>)

The APA format cite comes out as:

Show HN: One. Ycombinator.com. Retrieved Apr 30, 2014, from
[https://news.ycombinator.com](https://news.ycombinator.com).

The Chicago formate cite comes out as:

"Show HN: One." Ycombinator.com.
[https://news.ycombinator.com/](https://news.ycombinator.com/).

~~~
bradknowles
None of them get the subject correct, which is:

Show HN: One-click citations for your essays (speedcite.com)

~~~
michaelq
I see what you mean. Thanks for catching this! I agree, this needs to be fixed
ASAP.

------
rkuykendall-com
I clicked a book on the Amazon Books homepage and couldn't get it to work with
the URL, ISBN, or ISBN-14.

The Fault in Our Stars Paperback by John Green: [http://www.amazon.com/The-
Fault-Stars-John-Green/dp/01424241...](http://www.amazon.com/The-Fault-Stars-
John-
Green/dp/014242417X/ref=acs_ux_rw_ts_b_books_2_i/181-1226938-4232212?_encoding=UTF8&s=books&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=merchandised-
search-5&pf_rd_r=1KBZV025GCFHMJHM3TAC&pf_rd_t=101&pf_rd_p=1615333102&pf_rd_i=283155)

~~~
michaelq
[http://www.speedcite.com/?q=9780142424179&f=chi](http://www.speedcite.com/?q=9780142424179&f=chi)
works. I had to remove the dash from the ISBN-14. This is a known issue (as of
an hour ago). For the ISBN-10, there's a check digit X
([http://en.wikipedia.org/wiki/Check_digit#Design](http://en.wikipedia.org/wiki/Check_digit#Design))
that I haven't encountered before. Thank you for pointing out these issues!

------
tommorris
Can you add Wikipedia citation formats?

[https://en.wikipedia.org/wiki/Wikipedia:Citation_templates](https://en.wikipedia.org/wiki/Wikipedia:Citation_templates)

~~~
michaelq
I'm amazed Wikipedia doesn't have a first-party tool for this. I can look into
it. I'm trying to keep SpeedCite as simple as possible. If there is demand, I
could maybe build a stand-alone app for this?

~~~
tommorris
There's a few tools. There's some built-in JavaScript on Wikipedia, plus I use
[https://reftag.appspot.com/](https://reftag.appspot.com/) a lot and a few Vim
snipMate snippets.

------
quasque
Looks nice, but it doesn't retrieve results for many of the DOIs I tried, e.g.
10.1155/2014/863625 and 10.4103/0970-2113.129901, and gave an incorrect result
for this one: 10.1073/pnas.1324197111

Feature suggestions: would be nice if it accepted PubMed ids, and supported
other popular citation styles like Hardvard and Vancouver (or alternatively,
permitted some customisation of the citation format).

~~~
michaelq
Thanks for your feedback! Posting on HN seems to have caused speedcite to
exceed Google Scholar's rate limit, so I'll be switching to crossref.org for
DOIs. Using the new logic (which I'm about to push), I was able to get the
first two DOIs you mentioned, but I couldn't get 10.1073/pnas.1324197111
working on crossref.org or on Google Scholar. Where did you find this DOI? I'd
like to figure out a way to support it and its kind.

~~~
afandian
Do you know about the new CrossRef API? It might be of use. e.g.
[http://api.crossref.org/works/10.5555/12345678](http://api.crossref.org/works/10.5555/12345678)

You can check the Registration Agency with CrossRef to see who's responsible
for it:

[http://doi.crossref.org/ra/10.1073/pnas.1324197111](http://doi.crossref.org/ra/10.1073/pnas.1324197111)

In this case, it is CrossRef. So this should work:
[http://api.crossref.org/works/10.1073/pnas.1324197111](http://api.crossref.org/works/10.1073/pnas.1324197111)

It doesn't. I'll see if I can find out what's wrong.

If you have any questions you can email labs@crossref.org

EDIT: Looking at the Guest Query,
[http://www.crossref.org/guestquery/](http://www.crossref.org/guestquery/) it
looks like this was deposited recently. There may be a delay in propagation
through our systems.

~~~
quasque
How does CrossRef relate to the DOI Foundation? In particular I am curious as
to how the DOI data is shared - for example what caused that DOI to be
resolvable on dx.doi.org but not doi.crossref.org?

~~~
afandian
The DOI foundation is responsible for "making sure DOIs work" (I'm sure
there's a better definition than that!). Like DNS, there are a number of
Registration Agencies (RAs) who are responsible for registering DOIs. An
organisation such as CrossRef (or DataCite) RA will say "we want to become an
RA". They join, and can then register their own DOIs.

DOIs are persistent identifiers, and the main reason you want those is so you
can have a persistent link from one thing to another. A normal hyperlink is
subject to link-rot, which is an especially bad problem when you've got
printed journals or online 'printed journals'. A DOI is a link that goes via
the DOI to redirect to wherever the link is meant to point at this point in
history. RAs are responsible for registering DOIs and updating the link
redirect data whenever the thing being pointed to moves.

RAs exist for different purposes. CrossRef exists to enable linking between
scholarly publications, so we register DOIs for scholarly publications
(journal articles, books, etc). DataCite exists to enable linking to objects
like datasets.

CrossRef isn't just an DOI RA, but DOIs are a big part of what we do. In
addition to this we store metadata from publishers and then let anyone use our
APIs to get that data.

The DOI foundation maintains a load of DOI resolution servers. They all do the
same job: you click on a link, you're load-balanced to one of the machines,
and it replies with the relevant redirect.

Normally when you click on a DOI in a browser, you are redirected to the
appropriate URL. We introduced 'Content Negotiation' for DOIs, which means you
can supply an 'Accepts' header and get more bibliographic information about a
DOI. This works with a redirect.

Here's an example:

curl -L -iH "Accept: text/turtle"
[http://dx.doi.org/10.5555/515151](http://dx.doi.org/10.5555/515151)

That query is answered by one of the DOI servers. It doesn't matter which.

You see you're redirected to Location:
[http://data.crossref.org/10.5555%2F515151](http://data.crossref.org/10.5555%2F515151)

This is a CrossRef server and it knows all the publication metadata. This then
serves all the bibliographic data.

So TL;DR:

1 - The DOI foundation runs the DOI system

2 - CrossRef is an RA for DOIs

3 - Every RA runs its own resolution servers to spread the load

4 - Every resolution server can answer any DOI registered by any RA

5 - If you ask for bibliographic content negotiation on a CrossRef DOI, you'll
be redirected to the data.crossref.org server which will give you what you
asked for

And that DOI that worked on dx.doi.org but not data.CrossRef.org might be
because it can take a day for the data to propagate to various systems.

Any questions, labs@crossref.org

~~~
quasque
Fascinating, thanks for such a comprehensive response!

------
tlb
It didn't work with the ISBN I tried: 978-0-06-121495-0. For the paperback of
this book:
[https://en.wikipedia.org/wiki/What_Is_Your_Dangerous_Idea%3F](https://en.wikipedia.org/wiki/What_Is_Your_Dangerous_Idea%3F).
A google search on the ISBN finds it.

EDIT: aha, you have to remove dashes for it to work. It should probably do
this automatically.

~~~
michaelq
Thanks for pointing this out. I thought I'd corrected this problem. I will fix
this ASAP!

~~~
michaelq
I've fixed this issue.

------
bradknowles
Doesn't work on the web page at [http://gigaom.com/2014/04/29/supreme-court-
reverses-patent-j...](http://gigaom.com/2014/04/29/supreme-court-reverses-
patent-judges-again-in-9-0-decision-on-lawyer-fees/)

The subject line gets cut much too short, and the URL gets trimmed to the root
level of the domain.

~~~
michaelq
MLA, APA and Chicago style guides don't recommend including the full domain
unless it would be too difficult to otherwise find. Hence the truncation.

~~~
bradknowles
Okay, fair enough. But what about the full subject?

~~~
michaelq
You're right - sometimes it will truncate the full subject. I'm looking into
fixing this.

------
ofirnachum
Is there a reason it doesn't show author names when I submit a URL like
[http://www.sciencemag.org/content/210/4472/903.short](http://www.sciencemag.org/content/210/4472/903.short)
?

~~~
michaelq
Sciencemag.org uses a special metatag for authors (citation_author). I'm not
sure how common this is, but I will add logic to check these. Then SpeedCite
would properly cite the author.

~~~
aerialfish
Yeah I see the same happening with bbc. Example:
[http://www.bbc.com/news/health-27204988](http://www.bbc.com/news/health-27204988)

~~~
michaelq
The BBC doesn't have an author metatag for some reason. I can search for a
'byline' span as a fallback. Thanks for noticing this.

------
amadeusw
IEEE references would be fantastic!

I don't think the ISBN lookup works correctly. Typing in 9781405347587 or
978-1405347587 returns a book with ISBN 0-9690745-2-2

I'd be looking forward to upgraded version with IEEE but I just graduated, ha!

~~~
michaelq
Wow, I didn't realize IEEE had their own citation format.

Amazon has the ISBN 9781405347587. The only other google result for this is
your comment, which Google seems to have already indexed :)

Since Google Books doesn't have that ISBN, I would need 1) fail gracefully
instead of giving a citation for the wrong book and 2) have a fallback API.
I'm working on both of these. Thanks!

------
zmguy
I think it's interesting the URL citation does not actually include the URL.
It seems like the title of the article and the domain. Why is the exact URL of
the resource is not important?

~~~
michaelq
I could certainly include it, but doing so is not usually required for MLA,
APA or Chicago citations, and it would in many cases, make the citation really
long.

~~~
thecosas
I think that the reference makes sense as far as longevity. How often do links
to a specific page change? Very often. How often do domains change? Not as
often. MLA and other style guides are generally written with print in mind,
not links directly to content being cited.

~~~
zmguy
Sites that want their content linked, reused and cited should use some sort of
permalinking strategy. I don't think we should have a unverifiable citation
because a publication does not follow sound link generation strategies.
Provenance of the information is what we seek, citing a journal who doesn't
provide a time proof way to access the resource should not be cited.

------
jonlucc
An ISBN for a book shows up as a web resource in Google Books. Is there a way
to get it to just be the book?

~~~
michaelq
From the ISBN alone, it's difficult to differentiate between an electronic
book (such as one retrieved by Google Books) and a physical one. Would it be
helpful to add a switch allowing you to specify whether you want electronic
book citations or print book citations?

~~~
jonlucc
Yes, but personally, I think the ISBN identifies the physical book. We have
other ways to identify web resources, like by URL. Thanks!

------
RankingMember
Damn, this is awesome. I would've loved something like this back in school. I
did them manually.

------
jwb119
Awesome job. Would be really cool to see something like this for legal
citations as well.

~~~
michaelq
If you could link me to an example of a typical legal citation you would use,
I can look into it.

------
denzil_correa
You should introduce a Bibtex format too if you have to rope in the academia
crowd.

------
yongparkk
This is really neat. Wish I had this during my high school/college years.

------
sperling75
Cool, can I see an example ?

~~~
michaelq
Sure. Any DOI you pull off of Google scholar should work. Same with ISBNs off
the back of any book you have lying around. And it works with most news sites.
[http://www.speedcite.com/?q=http://www.usatoday.com/story/ne...](http://www.speedcite.com/?q=http://www.usatoday.com/story/news/usanow/2014/04/29/oklahoma-
executions-drugs-lethal-injection/8476389/&f=mla)

------
acbart
What does this offer over using Google Scholar's citations?

~~~
michaelq
If you already have a DOI on your clipboard or are copying it from your text
editor, it would save you a few clicks and page loads.

------
rubious_dan
I used KnightCite in college, this would have been great.

------
sperling75
Very cool. Would have saved me a ton of time.

------
jjyoung135
Super fast! Thanks for this great tool!

------
cabbeer
I used easybib.com for my school work.

~~~
jwcrux
Same here- I wonder what functionality this has over easybib.

~~~
michaelq
EasyBib has a ton of features and aims to be as comprehensive as possible, and
grants you more low-level control over the end citation. SpeedCite optimizes
for speed and simplicity.

------
anmilo
very cool, just forwarded this to some of my editor/writer friends

------
richardjordan
This is great. Nice work.

