On May 17, 2013, at 12:32 AM, Fitchett, Deborah wrote:
> Kia ora koutou,
>
> I’m wanting to create a bookmarklet that will let people on a journal article webpage just click the bookmarklet and get a permalink to that article, including our proxy information so it can be accessed off-campus.
>
> Once I’ve got a DOI (or other permalink, but I’ll cross that bridge later), the rest is easy. The trouble is getting the DOI. The options seem to be:
> Can anyone think of anything else I should be looking at for inspiration?
4. Look for any strings that look like a DOI:
\b((?:http://dx.doi.org/|doi:|)10.[\d.]+/(?:\S+))
(as it sucks to code special things for each database, in case they change or you add a new one)
You can then fall back to #1 if necessary.
> Also on a more general matter: I have the general level of Javascript that one gets by poking at things and doing small projects and then getting distracted by other things and then coming back some months later for a different small project and having to relearn it all over again. I’ve long had jQuery on my “I guess I’m going to have to learn this someday but, um, today I just wanna stick with what I know” list. So is this the kind of thing where it’s going to be quicker to learn something about jQuery before I get started, or can I just as easily muddle along with my existing limited Javascript? (What really are the pros and cons here?)
If depends on what you're going to do with the output -- I'd likely look through the <a href=''> values for http://dx.doi.org DOIs first, then just look at the text displaying on the page. I don't think you'd need jQuery for that.
-Joe
|