From: John Kitchin Date: Mon, 16 Mar 2015 12:42:23 +0000 (-0400) Subject: Initial commit of wos.el X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=commitdiff_plain;h=e620af30a93e5424e5c080c8eedeb85ac2af1567 Initial commit of wos.el --- diff --git a/wos.el b/wos.el new file mode 100644 index 0000000..e0a321a --- /dev/null +++ b/wos.el @@ -0,0 +1,63 @@ +;;; wos.el --- WEb of Science functions -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 John Kitchin + +;; Author: John Kitchin +;; Keywords: + +;; This program 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. + +;; This program 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. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Adds a new org-mode link for a search in Web of Science. + + +;;; Code: +(org-add-link-type + "wos" + (lambda (path) + (browse-url + (format "http://gateway.webofknowledge.com/gateway/Gateway.cgi?topic=%s&GWVersion=2&SrcApp=WEB&SrcAuth=HSB&DestApp=UA&DestLinkType=GeneralSearchSummary" + (s-join "+" + (split-string path))))) + ;; formatting function. Assume html + (lambda (link desc format) + (format "%s" + (format "http://gateway.webofknowledge.com/gateway/Gateway.cgi?topic=%s&GWVersion=2&SrcApp=WEB&SrcAuth=HSB&DestApp=UA&DestLinkType=GeneralSearchSummary" + (s-join "+" + (split-string path))) + (format "wos:%s" link) + ))) + + +(defun wos-search () + "Open the word at point or selection in Web of Science." + ;; the url was derived from this page: http://wokinfo.com/webtools/searchbox/ + (interactive) + (browse-url + (format "http://gateway.webofknowledge.com/gateway/Gateway.cgi?topic=%s&GWVersion=2&SrcApp=WEB&SrcAuth=HSB&DestApp=UA&DestLinkType=GeneralSearchSummary" + (if (region-active-p) + (mapconcat 'identity (split-string + (buffer-substring (region-beginning) + (region-end))) "+") + (thing-at-point 'word))))) + + +(defun wos () + "Open Web of Science search page in a browser." + (interactive) + (browse-url "http://apps.webofknowledge.com")) + +(provide 'wos) +;;; wos.el ends here