private void AddTextUrlToDownloadList(Post post) { if (!Blog.DownloadText || post.Type != "regular") { return; } string textBody = tumblrJsonParser.ParseText(post); AddToDownloadList(new TextPost(textBody, post.Id)); AddToJsonQueue(new CrawlerData <Post>(Path.ChangeExtension(post.Id, ".json"), post)); }
private void AddTextUrlToDownloadList(Post post) { if (!Blog.DownloadText) { return; } if (post.Type != "text") { return; } string postId = post.Id; string textBody = tumblrJsonParser.ParseText(post); AddToDownloadList(new TextPost(textBody, postId, post.Timestamp.ToString())); AddToJsonQueue(new CrawlerData <Post>(Path.ChangeExtension(postId, ".json"), post)); }
private void DownloadText(dynamic dynPost, Post post) { if (Blog.DownloadText && (GetValue(dynPost, "originalType") == "regular" || GetValue(dynPost, "original_type") == "regular")) { string text = ""; foreach (var content in (IEnumerable <dynamic>)dynPost.content) { if (content.type == "text") { text += content.text + Environment.NewLine; } } post.RegularBody = text; string textBody = tumblrJsonParser.ParseText(post); AddToDownloadList(new TextPost(textBody, post.Id, post.UnixTimestamp.ToString())); } }
private void AddTextUrlToDownloadList(TumblrJson document) { if (blog.DownloadText) { foreach (Post post in document.response.posts) { if (!PostWithinTimeSpan(post)) { continue; } if ((post.type == "text") && (!tags.Any() || post.tags.Intersect(tags, StringComparer.OrdinalIgnoreCase).Any())) { if (CheckIfDownloadRebloggedPosts(post)) { string postId = post.id; string textBody = tumblrJsonParser.ParseText(post); AddToDownloadList(new TextPost(textBody, postId, post.timestamp.ToString())); AddToJsonQueue(new TumblrCrawlerData <Post>(Path.ChangeExtension(postId, ".json"), post)); } } } } }
private void AddTextUrlToDownloadList(TumblrApiJson document) { if (blog.DownloadText) { foreach (Post post in document.posts) { if (!PostWithinTimeSpan(post)) { continue; } if (post.type == "regular" && (!tags.Any() || post.tags.Any(x => tags.Contains(x, StringComparer.OrdinalIgnoreCase)))) { if (CheckIfDownloadRebloggedPosts(post)) { string textBody = tumblrJsonParser.ParseText(post); AddToDownloadList(new TextPost(textBody, post.id)); AddToJsonQueue(new TumblrCrawlerData <Post>(Path.ChangeExtension(post.id, ".json"), post)); } } } } }