From e620af30a93e5424e5c080c8eedeb85ac2af1567 Mon Sep 17 00:00:00 2001 From: John Kitchin Date: Mon, 16 Mar 2015 08:42:23 -0400 Subject: [PATCH] Initial commit of wos.el --- wos.el | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 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 -- 2.39.2