Beispiel #1
0
        public Rootobject GetItem(string id)
        {
            Rootobject result = null;
            string     url    = $"{Scheme}://archive.org/metadata/{id}";

            using (WebClient client = new WebClient())
            {
                string json = client.DownloadString(url);
                result = Rootobject.FromJson(json);
            }
            return(result);
        }
Beispiel #2
0
        public Response RunQuery(Query queryObj)
        {
            Response result = null;
            string   query  = queryObj.GetQueryString();
            string   url    = $"{Scheme}://archive.org/advancedsearch.php?{query}";

            using (WebClient client = new WebClient())
            {
                string json = client.DownloadString(url);
                result = Rootobject.FromJson(json)?.response;
            }
            return(result);
        }