X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ftorus.cpp;h=bd0a63bc9d1564e5f256f240f53547c9ffb3d7fe;hb=dd21227b80709993b132d073d3276e875f54fca4;hp=d2ebd9f82a8691ae84ad9b53a63e75471e8d6245;hpb=6bbc073d4048f6bbff75e165b7539b9adbe22559;p=metaproxy-moved-to-github.git diff --git a/src/torus.cpp b/src/torus.cpp index d2ebd9f..bd0a63b 100644 --- a/src/torus.cpp +++ b/src/torus.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2011 Index Data + Copyright (C) 2005-2012 Index Data Metaproxy 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 @@ -29,13 +29,20 @@ namespace mp = metaproxy_1; xmlDoc *mp::get_searchable(mp::Package &package, std::string url_template, const std::string &db, + const std::string &query, const std::string &realm, const std::string &proxy) { - // http://newmk2.indexdata.com/torus2/searchable.ebsco/records/?query=udb=aberdeenUni + // http://mk2.indexdata.com/torus2/searchable/records/?query=udb%3d%db + // or + // http://mk2.indexdata.com/torus2/searchable/records/?query=%query xmlDoc *doc = 0; size_t found; + found = url_template.find("%query"); + if (found != std::string::npos) + url_template.replace(found, 6, mp::util::uri_encode(query)); + found = url_template.find("%db"); if (found != std::string::npos) url_template.replace(found, 3, mp::util::uri_encode(db));