public async Task testMetaDataSearch() { var metadata = await MetaDataApi <object> .getMetaDataAsync("bigchaindb"); //metadata.Count.ShouldBe(3); //metadata[0].Id.ShouldBe("51ce82a14ca274d43e4992bbce41f6fdeb755f846e48e710a3bbb3b0cf8e4204"); }
public async Task testMetaDataSearchWithLimit() { var metadata = await MetaDataApi <object> .getMetaDataWithLimitAsync("bigchaindb", 2); metadata.Count.ShouldBe(2); }
private static MetaDataApi FillMetaDataObject(Post post) { var md = new MetaDataApi { Date = post.Date, DateGmt = post.DateGmt, Format = post.Format, Id = post.Id, Slug = post.Slug, Tags = post.Tags, Type = post.Type, UnixTimestamp = post.UnixTimestamp, Url = post.Url, UrlWithSlug = post.UrlWithSlug, ReblogKey = post.ReblogKey }; if (!string.IsNullOrEmpty(post.RebloggedFromName)) { md.RebloggedFromName = post.RebloggedFromName; } if (!string.IsNullOrEmpty(post.RebloggedFromTitle)) { md.RebloggedFromTitle = post.RebloggedFromTitle; } if (!string.IsNullOrEmpty(post.RebloggedFromUrl)) { md.RebloggedFromUrl = post.RebloggedFromUrl; } if (!string.IsNullOrEmpty(post.RebloggedRootName)) { md.RebloggedRootName = post.RebloggedRootName; } if (!string.IsNullOrEmpty(post.RebloggedRootTitle)) { md.RebloggedRootTitle = post.RebloggedRootTitle; } if (!string.IsNullOrEmpty(post.RebloggedRootUrl)) { md.RebloggedRootUrl = post.RebloggedRootUrl; } if (post.Type == "regular") { md.RegularBody = post.RegularBody; md.RegularTitle = post.RegularTitle; md.DownloadedMediaFiles = (post.DownloadedFilenames?.Count > 0) ? post.DownloadedFilenames : null; } else if (post.Type == "audio") { md.AudioCaption = post.AudioCaption; md.AudioEmbed = post.AudioEmbed; md.AudioPlayer = post.AudioPlayer; md.AudioPlays = post.AudioPlays; md.Id3Album = post.Id3Album; md.Id3Artist = post.Id3Artist; md.Id3Title = post.Id3Title; md.Id3Track = post.Id3Track; md.Id3Year = post.Id3Year; md.DownloadedMediaFiles = post.DownloadedFilenames; } else if (post.Type == "photo") { md.PhotoCaption = post.PhotoCaption; md.PhotoLinkUrl = post.PhotoLinkUrl; md.PhotoUrl100 = post.PhotoUrl100; md.PhotoUrl1280 = post.PhotoUrl1280; md.PhotoUrl250 = post.PhotoUrl250; md.PhotoUrl400 = post.PhotoUrl400; md.PhotoUrl500 = post.PhotoUrl500; md.PhotoUrl75 = post.PhotoUrl75; md.Photos = post.Photos; md.DownloadedMediaFiles = post.DownloadedFilenames; } else if (post.Type == "video") { md.VideoCaption = post.VideoCaption; md.VideoPlayer = post.VideoPlayer; md.VideoPlayer250 = post.VideoPlayer250; md.VideoPlayer500 = post.VideoPlayer500; md.VideoSource = post.VideoSource; md.DownloadedMediaFiles = post.DownloadedFilenames; } else if (post.Type == "answer") { md.Answer = post.Answer; md.Question = post.Question; } else if (post.Type == "quote") { md.QuoteText = post.QuoteText; md.QuoteSource = post.QuoteSource; } else if (post.Type == "conversation") { md.Conversation = post.Conversation; md.ConversationText = post.ConversationText; md.ConversationTitle = post.ConversationTitle; } else if (post.Type == "link") { md.LinkDescription = post.LinkDescription; md.LinkText = post.LinkText; md.LinkUrl = post.LinkUrl; } return(md); }