Example #1
0
        public override async Task <InspirationCollection> Search(string matchPhrase, int num, int page = 0)
        {
            var result = await GetFeed(matchPhrase, num, page);

            var collection = new InspirationCollection();

            collection.SearchTerm    = matchPhrase;
            collection.TotalMatching = result["total"].Value <int>();
            foreach (var item in result["results"])
            {
                var card = new InspirationCard();
                card.Title   = item["bibjson"]["title"].Value <string>();
                card.Summary = item["bibjson"]["abstract"]?.Value <string>();
                card.Link    = _doajBase.Replace("{article-id}", item["id"].Value <string>());
                card.Id      = item["id"].Value <string>();
                collection.Add(card);
            }
            return(collection);
        }
Example #2
0
        public override async Task <InspirationCollection> Search(string matchPhrase, int num, int page = 0)
        {
            var result = await GetFeed(matchPhrase, num, page);

            var collection = new InspirationCollection();

            collection.SearchTerm    = matchPhrase;
            collection.TotalMatching = result["opensearch:totalResults"]["#text"].Value <int>();
            foreach (var e in result["entry"])
            {
                var card = new InspirationCard();
                card.Summary = e["summary"].Value <string>();
                card.Title   = e["title"].Value <string>();
                card.Link    = e["id"].Value <string>();
                card.Id      = e["id"].Value <string>();
                collection.Add(card);
            }
            return(collection);
        }