From fe9e21f8fd4da82d5f3a3f27a854723b97c20832 Mon Sep 17 00:00:00 2001 From: Jan Klausa Date: Fri, 22 Feb 2019 01:27:25 +0100 Subject: [PATCH 1/2] Add support for fetching detail stats for specific post --- WordPressKit.xcodeproj/project.pbxproj | 9 +- WordPressKit/StatsPostDetails.swift | 148 + WordPressKit/StatsServiceRemoteV2.swift | 18 + .../Mock Data/stats-post-details.json | 5428 +++++++++++++++++ WordPressKitTests/StatsRemoteV2Tests.swift | 78 +- 5 files changed, 5679 insertions(+), 2 deletions(-) create mode 100644 WordPressKit/StatsPostDetails.swift create mode 100644 WordPressKitTests/Mock Data/stats-post-details.json diff --git a/WordPressKit.xcodeproj/project.pbxproj b/WordPressKit.xcodeproj/project.pbxproj index d4b3de56..e2ca09db 100644 --- a/WordPressKit.xcodeproj/project.pbxproj +++ b/WordPressKit.xcodeproj/project.pbxproj @@ -36,6 +36,8 @@ 40819771221DFDB700A298E4 /* stats-posts-data.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819770221DFDB600A298E4 /* stats-posts-data.json */; }; 40819773221E10C900A298E4 /* PublishedPostsStatsType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819772221E10C900A298E4 /* PublishedPostsStatsType.swift */; }; 40819775221E497D00A298E4 /* stats-published-posts.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819774221E497C00A298E4 /* stats-published-posts.json */; }; + 40819783221F5C8200A298E4 /* StatsPostDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819782221F5C8200A298E4 /* StatsPostDetails.swift */; }; + 40819785221F74B200A298E4 /* stats-post-details.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819784221F74B200A298E4 /* stats-post-details.json */; }; 40A71C6E220E1D8E002E3D25 /* StatsServiceRemoteV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40A71C6D220E1D8E002E3D25 /* StatsServiceRemoteV2.swift */; }; 40AB1ADA200FED25009B533D /* PluginDirectoryFeedPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40AB1AD9200FED25009B533D /* PluginDirectoryFeedPage.swift */; }; 40E4698B2017C2840030DB5F /* plugin-directory-popular.json in Resources */ = {isa = PBXBuildFile; fileRef = 40E4698A2017C2840030DB5F /* plugin-directory-popular.json */; }; @@ -525,7 +527,8 @@ 40819770221DFDB600A298E4 /* stats-posts-data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-posts-data.json"; sourceTree = ""; }; 40819772221E10C900A298E4 /* PublishedPostsStatsType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishedPostsStatsType.swift; sourceTree = ""; }; 40819774221E497C00A298E4 /* stats-published-posts.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-published-posts.json"; sourceTree = ""; }; - + 40819782221F5C8200A298E4 /* StatsPostDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsPostDetails.swift; sourceTree = ""; }; + 40819784221F74B200A298E4 /* stats-post-details.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-post-details.json"; sourceTree = ""; }; 40A71C6D220E1D8E002E3D25 /* StatsServiceRemoteV2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsServiceRemoteV2.swift; sourceTree = ""; }; 40AB1AD9200FED25009B533D /* PluginDirectoryFeedPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginDirectoryFeedPage.swift; sourceTree = ""; }; 40E4698A2017C2840030DB5F /* plugin-directory-popular.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "plugin-directory-popular.json"; sourceTree = ""; }; @@ -1059,6 +1062,7 @@ 404057C3221B30140060250C /* Time-based data */, 40414061220F9F2800CF7C5B /* Insights */, F96E0642221E15A9008E7D97 /* StatsLastPostInsight.swift */, + 40819782221F5C8200A298E4 /* StatsPostDetails.swift */, ); name = V2; sourceTree = ""; @@ -1551,6 +1555,7 @@ 93BD27421EE73384002BB00B /* Mock Data */ = { isa = PBXGroup; children = ( + 40819784221F74B200A298E4 /* stats-post-details.json */, 40819770221DFDB600A298E4 /* stats-posts-data.json */, 40819774221E497C00A298E4 /* stats-published-posts.json */, 404057DB221C9FD70060250C /* stats-referrer-data.json */, @@ -2006,6 +2011,7 @@ 93BD275C1EE73442002BB00B /* is-available-username-success.json in Resources */, 93AC8ED81ED32FD000900F5A /* stats-v1.1-top-posts-day.json in Resources */, 74D67F331F15C3740010C5ED /* site-users-delete-auth-failure.json in Resources */, + 40819785221F74B200A298E4 /* stats-post-details.json in Resources */, 436D563A2118DE3B00CEAA33 /* supported-countries-success.json in Resources */, 740B23E71F17FB4200067A2A /* xmlrpc-metaweblog-newpost-success.xml in Resources */, 74FC6F411F191C1D00112505 /* notifications-last-seen.json in Resources */, @@ -2347,6 +2353,7 @@ 93BD27831EE73944002BB00B /* WordPressRSDParser.swift in Sources */, 7328420421CD786C00126755 /* WordPressComServiceRemote+SiteCreation.swift in Sources */, 826016F31F9FA17B00533B6C /* Activity.swift in Sources */, + 40819783221F5C8200A298E4 /* StatsPostDetails.swift in Sources */, 7397F01A220A072500C723F3 /* ActivityServiceRemote_ApiVersion1_0.swift in Sources */, 40E7FEB1220FB3B60032834E /* StatsAnnualAndMostPopularTimeInsight.swift in Sources */, 7E3E7A4A20E443890075D159 /* Scanner+extensions.swift in Sources */, diff --git a/WordPressKit/StatsPostDetails.swift b/WordPressKit/StatsPostDetails.swift new file mode 100644 index 00000000..ff193ab3 --- /dev/null +++ b/WordPressKit/StatsPostDetails.swift @@ -0,0 +1,148 @@ +public struct StatsPostDetails { + public let fetchedDate: Date + public let totalViewsCount: Int + + public let recentWeeks: [StatsWeeklyBreakdown] + public let dailyAveragesPerMonth: [StatsPostViews] + public let monthlyBreakdown: [StatsPostViews] + public let lastTwoWeeks: [StatsPostViews] +} + +public struct StatsWeeklyBreakdown { + public let startDay: DateComponents + public let endDay: DateComponents + + public let totalViewsCount: Int + public let averageViewsCount: Int + public let changePercentage: Double + + public let days: [StatsPostViews] +} + +public struct StatsPostViews { + public let period: StatsPeriodUnit + public let date: DateComponents + public let viewsCount: Int +} + +extension StatsPostDetails { + init?(jsonDictionary: [String: AnyObject]) { + guard + let fetchedDateString = jsonDictionary["date"] as? String, + let date = type(of: self).dateFormatter.date(from: fetchedDateString), + let totalViewsCount = jsonDictionary["views"] as? Int, + let monthlyBreakdown = jsonDictionary["years"] as? [String: AnyObject], + let monthlyAverages = jsonDictionary["averages"] as? [String: AnyObject], + let recentWeeks = jsonDictionary["weeks"] as? [[String: AnyObject]], + let data = jsonDictionary["data"] as? [[Any]] + else { + return nil + } + + self.fetchedDate = date + self.totalViewsCount = totalViewsCount + + // It's very hard to describe the format of this response. I tried to make the parsing + // as nice and readable as possible, but in all honestly it's still pretty nasty. + // If you want to see an example response to see how weird this response is, check out + // `stats-post-details.json`. + self.recentWeeks = StatsPostViews.mapWeeklyBreakdown(jsonDictionary: recentWeeks) + self.monthlyBreakdown = StatsPostViews.mapMonthlyBreakdown(jsonDictionary: monthlyBreakdown) + self.dailyAveragesPerMonth = StatsPostViews.mapMonthlyBreakdown(jsonDictionary: monthlyAverages) + self.lastTwoWeeks = StatsPostViews.mapDailyData(data: Array(data.suffix(14))) + } + + static var dateFormatter: DateFormatter { + let df = DateFormatter() + df.locale = Locale(identifier: "en_US_POS") + df.dateFormat = "yyyy-MM-dd" + return df + } +} + +extension StatsPostViews { + static func mapMonthlyBreakdown(jsonDictionary: [String: AnyObject]) -> [StatsPostViews] { + return jsonDictionary.flatMap { yearKey, value -> [StatsPostViews] in + guard + let yearInt = Int(yearKey), + let monthsDict = value as? [String: AnyObject], + let months = monthsDict["months"] as? [String: Int] + else { + return [] + } + + return months.compactMap { monthKey, value in + guard + let month = Int(monthKey) + else { + return nil + } + + return StatsPostViews(period: .month, + date: DateComponents(year: yearInt, month: month), + viewsCount: value) + } + } + } +} + +extension StatsPostViews { + static func mapWeeklyBreakdown(jsonDictionary: [[String: AnyObject]]) -> [StatsWeeklyBreakdown] { + return jsonDictionary.compactMap { + guard + let totalViews = $0["total"] as? Int, + let averageViews = $0["average"] as? Int, + let days = $0["days"] as? [[String: AnyObject]] + else { + return nil + } + + let change = ($0["change"] as? Double) ?? 0.0 + + let mappedDays: [StatsPostViews] = days.compactMap { + guard + let dayString = $0["day"] as? String, + let date = StatsPostDetails.dateFormatter.date(from: dayString), + let viewsCount = $0["count"] as? Int + else { + return nil + } + + return StatsPostViews(period: .day, + date: Calendar.autoupdatingCurrent.dateComponents([.year, .month, .day], from: date), + viewsCount: viewsCount) + } + + guard !mappedDays.isEmpty else { + return nil + } + + + return StatsWeeklyBreakdown(startDay: mappedDays.first!.date, + endDay: mappedDays.last!.date, + totalViewsCount: totalViews, + averageViewsCount: averageViews, + changePercentage: change, + days: mappedDays) + } + + } +} + +extension StatsPostViews { + static func mapDailyData(data: [[Any]]) -> [StatsPostViews] { + return data.compactMap { + guard + let dateString = $0[0] as? String, + let date = StatsPostDetails.dateFormatter.date(from: dateString), + let viewsCount = $0[1] as? Int + else { + return nil + } + + return StatsPostViews(period: .day, + date: Calendar.autoupdatingCurrent.dateComponents([.year, .month, .day], from: date), + viewsCount: viewsCount) + } + } +} diff --git a/WordPressKit/StatsServiceRemoteV2.swift b/WordPressKit/StatsServiceRemoteV2.swift index 9e48c300..77bf7364 100644 --- a/WordPressKit/StatsServiceRemoteV2.swift +++ b/WordPressKit/StatsServiceRemoteV2.swift @@ -97,6 +97,24 @@ public class StatsServiceRemoteV2: ServiceRemoteWordPressComREST { completion(nil, error) }) } + + public func getDetails(forPostID postID: Int, completion: @escaping ((StatsPostDetails?, Error?) -> Void)) { + let path = self.path(forEndpoint: "sites/\(siteID)/post/\(postID)/", withVersion: ._1_1) + + wordPressComRestApi.GET(path, parameters: [:], success: { (response, _) in + guard + let jsonResponse = response as? [String: AnyObject], + let postDetails = StatsPostDetails(jsonDictionary: jsonResponse) + else { + completion(nil, ResponseError.decodingFailure) + return + } + + completion(postDetails, nil) + }, failure: { (error, _) in + completion(nil, error) + }) + } } // MARK: - StatsLastPostInsight-specific hack diff --git a/WordPressKitTests/Mock Data/stats-post-details.json b/WordPressKitTests/Mock Data/stats-post-details.json new file mode 100644 index 00000000..de3d3edb --- /dev/null +++ b/WordPressKitTests/Mock Data/stats-post-details.json @@ -0,0 +1,5428 @@ +{ + "date": "2019-02-21", + "views": 163343, + "years": { + "2015": { + "months": { + "3": 1525, + "4": 6966, + "5": 5175, + "6": 3547, + "7": 2457, + "8": 4637, + "9": 6004, + "10": 1212, + "11": 2621, + "12": 3717 + }, + "total": 37861 + }, + "2016": { + "months": { + "1": 4467, + "2": 3255, + "3": 2856, + "4": 2244, + "5": 2837, + "6": 2716, + "7": 3063, + "8": 4111, + "9": 2683, + "10": 3680, + "11": 2242, + "12": 2293 + }, + "total": 36447 + }, + "2017": { + "months": { + "1": 4350, + "2": 2667, + "3": 3383, + "4": 3977, + "5": 2578, + "6": 3454, + "7": 2359, + "8": 2436, + "9": 2120, + "10": 3365, + "11": 3689, + "12": 3151 + }, + "total": 37529 + }, + "2018": { + "months": { + "1": 3491, + "2": 2697, + "3": 8800, + "4": 2702, + "5": 3496, + "6": 3361, + "7": 3537, + "8": 3097, + "9": 2851, + "10": 4144, + "11": 4579, + "12": 2674 + }, + "total": 45429 + }, + "2019": { + "months": { + "1": 3499, + "2": 2578 + }, + "total": 6077 + } + }, + "averages": { + "2015": { + "months": { + "3": 101, + "4": 232, + "5": 166, + "6": 118, + "7": 79, + "8": 149, + "9": 200, + "10": 39, + "11": 87, + "12": 119 + }, + "overall": 130 + }, + "2016": { + "months": { + "1": 144, + "2": 112, + "3": 92, + "4": 74, + "5": 91, + "6": 90, + "7": 98, + "8": 132, + "9": 89, + "10": 118, + "11": 74, + "12": 73 + }, + "overall": 99 + }, + "2017": { + "months": { + "1": 140, + "2": 95, + "3": 109, + "4": 132, + "5": 83, + "6": 115, + "7": 76, + "8": 78, + "9": 70, + "10": 108, + "11": 122, + "12": 101 + }, + "overall": 102 + }, + "2018": { + "months": { + "1": 112, + "2": 96, + "3": 283, + "4": 90, + "5": 112, + "6": 112, + "7": 114, + "8": 99, + "9": 95, + "10": 133, + "11": 152, + "12": 86 + }, + "overall": 124 + }, + "2019": { + "months": { + "1": 112, + "2": 112 + }, + "overall": 112 + } + }, + "weeks": [ + { + "days": [ + { + "day": "2019-01-14", + "count": 174 + }, + { + "day": "2019-01-15", + "count": 167 + }, + { + "day": "2019-01-16", + "count": 48 + }, + { + "day": "2019-01-17", + "count": 177 + }, + { + "day": "2019-01-18", + "count": 43 + }, + { + "day": "2019-01-19", + "count": 19 + }, + { + "day": "2019-01-20", + "count": 60 + } + ], + "total": 688, + "average": 98, + "change": null + }, + { + "days": [ + { + "day": "2019-01-21", + "count": 111 + }, + { + "day": "2019-01-22", + "count": 35 + }, + { + "day": "2019-01-23", + "count": 114 + }, + { + "day": "2019-01-24", + "count": 143 + }, + { + "day": "2019-01-25", + "count": 199 + }, + { + "day": "2019-01-26", + "count": 113 + }, + { + "day": "2019-01-27", + "count": 46 + } + ], + "total": 761, + "average": 108, + "change": 10.610465116279059 + }, + { + "days": [ + { + "day": "2019-01-28", + "count": 276 + }, + { + "day": "2019-01-29", + "count": 74 + }, + { + "day": "2019-01-30", + "count": 45 + }, + { + "day": "2019-01-31", + "count": 334 + }, + { + "day": "2019-02-01", + "count": 193 + }, + { + "day": "2019-02-02", + "count": 25 + }, + { + "day": "2019-02-03", + "count": 62 + } + ], + "total": 1009, + "average": 144, + "change": 32.58869908015768 + }, + { + "days": [ + { + "day": "2019-02-04", + "count": 78 + }, + { + "day": "2019-02-05", + "count": 63 + }, + { + "day": "2019-02-06", + "count": 71 + }, + { + "day": "2019-02-07", + "count": 61 + }, + { + "day": "2019-02-08", + "count": 112 + }, + { + "day": "2019-02-09", + "count": 103 + }, + { + "day": "2019-02-10", + "count": 30 + } + ], + "total": 518, + "average": 74, + "change": -48.66204162537166 + }, + { + "days": [ + { + "day": "2019-02-11", + "count": 88 + }, + { + "day": "2019-02-12", + "count": 149 + }, + { + "day": "2019-02-13", + "count": 57 + }, + { + "day": "2019-02-14", + "count": 143 + }, + { + "day": "2019-02-15", + "count": 271 + }, + { + "day": "2019-02-16", + "count": 152 + }, + { + "day": "2019-02-17", + "count": 53 + } + ], + "total": 913, + "average": 130, + "change": 76.25482625482624 + }, + { + "days": [ + { + "day": "2019-02-18", + "count": 157 + }, + { + "day": "2019-02-19", + "count": 263 + }, + { + "day": "2019-02-20", + "count": 123 + }, + { + "day": "2019-02-21", + "count": 324 + } + ], + "total": 867, + "average": 181, + "change": 38.77327491785326 + } + ], + "fields": [ + "period", + "views" + ], + "data": [ + [ + "2015-09-05", + 1 + ], + [ + "2015-09-06", + 14 + ], + [ + "2015-09-07", + 99 + ], + [ + "2015-09-08", + 95 + ], + [ + "2015-09-09", + 4 + ], + [ + "2015-09-10", + 13 + ], + [ + "2015-09-11", + 372 + ], + [ + "2015-09-12", + 1128 + ], + [ + "2015-09-13", + 702 + ], + [ + "2015-09-14", + 709 + ], + [ + "2015-09-15", + 463 + ], + [ + "2015-09-16", + 264 + ], + [ + "2015-09-17", + 261 + ], + [ + "2015-09-18", + 300 + ], + [ + "2015-09-19", + 143 + ], + [ + "2015-09-20", + 81 + ], + [ + "2015-09-21", + 151 + ], + [ + "2015-09-22", + 221 + ], + [ + "2015-09-23", + 145 + ], + [ + "2015-09-24", + 106 + ], + [ + "2015-09-25", + 158 + ], + [ + "2015-09-26", + 84 + ], + [ + "2015-09-27", + 46 + ], + [ + "2015-09-28", + 107 + ], + [ + "2015-09-29", + 23 + ], + [ + "2015-09-30", + 104 + ], + [ + "2015-10-01", + 104 + ], + [ + "2015-10-02", + 13 + ], + [ + "2015-10-03", + 18 + ], + [ + "2015-10-04", + 22 + ], + [ + "2015-10-05", + 74 + ], + [ + "2015-10-06", + 68 + ], + [ + "2015-10-07", + 42 + ], + [ + "2015-10-08", + 7 + ], + [ + "2015-10-09", + 8 + ], + [ + "2015-10-10", + 65 + ], + [ + "2015-10-11", + 31 + ], + [ + "2015-10-12", + 28 + ], + [ + "2015-10-13", + 36 + ], + [ + "2015-10-14", + 18 + ], + [ + "2015-10-15", + 31 + ], + [ + "2015-10-16", + 15 + ], + [ + "2015-10-17", + 13 + ], + [ + "2015-10-18", + 7 + ], + [ + "2015-10-19", + 45 + ], + [ + "2015-10-20", + 77 + ], + [ + "2015-10-21", + 52 + ], + [ + "2015-10-22", + 33 + ], + [ + "2015-10-23", + 43 + ], + [ + "2015-10-24", + 0 + ], + [ + "2015-10-25", + 9 + ], + [ + "2015-10-26", + 41 + ], + [ + "2015-10-27", + 39 + ], + [ + "2015-10-28", + 40 + ], + [ + "2015-10-29", + 2 + ], + [ + "2015-10-30", + 183 + ], + [ + "2015-10-31", + 48 + ], + [ + "2015-11-01", + 13 + ], + [ + "2015-11-02", + 33 + ], + [ + "2015-11-03", + 26 + ], + [ + "2015-11-04", + 33 + ], + [ + "2015-11-05", + 70 + ], + [ + "2015-11-06", + 72 + ], + [ + "2015-11-07", + 49 + ], + [ + "2015-11-08", + 13 + ], + [ + "2015-11-09", + 26 + ], + [ + "2015-11-10", + 49 + ], + [ + "2015-11-11", + 8 + ], + [ + "2015-11-12", + 61 + ], + [ + "2015-11-13", + 33 + ], + [ + "2015-11-14", + 53 + ], + [ + "2015-11-15", + 69 + ], + [ + "2015-11-16", + 93 + ], + [ + "2015-11-17", + 447 + ], + [ + "2015-11-18", + 296 + ], + [ + "2015-11-19", + 18 + ], + [ + "2015-11-20", + 132 + ], + [ + "2015-11-21", + 52 + ], + [ + "2015-11-22", + 56 + ], + [ + "2015-11-23", + 154 + ], + [ + "2015-11-24", + 177 + ], + [ + "2015-11-25", + 280 + ], + [ + "2015-11-26", + 136 + ], + [ + "2015-11-27", + 74 + ], + [ + "2015-11-28", + 54 + ], + [ + "2015-11-29", + 15 + ], + [ + "2015-11-30", + 29 + ], + [ + "2015-12-01", + 183 + ], + [ + "2015-12-02", + 43 + ], + [ + "2015-12-03", + 48 + ], + [ + "2015-12-04", + 100 + ], + [ + "2015-12-05", + 11 + ], + [ + "2015-12-06", + 97 + ], + [ + "2015-12-07", + 34 + ], + [ + "2015-12-08", + 96 + ], + [ + "2015-12-09", + 68 + ], + [ + "2015-12-10", + 117 + ], + [ + "2015-12-11", + 53 + ], + [ + "2015-12-12", + 75 + ], + [ + "2015-12-13", + 19 + ], + [ + "2015-12-14", + 18 + ], + [ + "2015-12-15", + 268 + ], + [ + "2015-12-16", + 91 + ], + [ + "2015-12-17", + 1211 + ], + [ + "2015-12-18", + 315 + ], + [ + "2015-12-19", + 30 + ], + [ + "2015-12-20", + 30 + ], + [ + "2015-12-21", + 74 + ], + [ + "2015-12-22", + 212 + ], + [ + "2015-12-23", + 83 + ], + [ + "2015-12-24", + 77 + ], + [ + "2015-12-25", + 2 + ], + [ + "2015-12-26", + 6 + ], + [ + "2015-12-27", + 18 + ], + [ + "2015-12-28", + 67 + ], + [ + "2015-12-29", + 108 + ], + [ + "2015-12-30", + 125 + ], + [ + "2015-12-31", + 38 + ], + [ + "2016-01-01", + 27 + ], + [ + "2016-01-02", + 7 + ], + [ + "2016-01-03", + 57 + ], + [ + "2016-01-04", + 187 + ], + [ + "2016-01-05", + 307 + ], + [ + "2016-01-06", + 301 + ], + [ + "2016-01-07", + 284 + ], + [ + "2016-01-08", + 170 + ], + [ + "2016-01-09", + 50 + ], + [ + "2016-01-10", + 99 + ], + [ + "2016-01-11", + 186 + ], + [ + "2016-01-12", + 198 + ], + [ + "2016-01-13", + 166 + ], + [ + "2016-01-14", + 82 + ], + [ + "2016-01-15", + 59 + ], + [ + "2016-01-16", + 68 + ], + [ + "2016-01-17", + 71 + ], + [ + "2016-01-18", + 150 + ], + [ + "2016-01-19", + 132 + ], + [ + "2016-01-20", + 354 + ], + [ + "2016-01-21", + 184 + ], + [ + "2016-01-22", + 139 + ], + [ + "2016-01-23", + 42 + ], + [ + "2016-01-24", + 114 + ], + [ + "2016-01-25", + 128 + ], + [ + "2016-01-26", + 246 + ], + [ + "2016-01-27", + 214 + ], + [ + "2016-01-28", + 163 + ], + [ + "2016-01-29", + 142 + ], + [ + "2016-01-30", + 103 + ], + [ + "2016-01-31", + 37 + ], + [ + "2016-02-01", + 135 + ], + [ + "2016-02-02", + 232 + ], + [ + "2016-02-03", + 189 + ], + [ + "2016-02-04", + 79 + ], + [ + "2016-02-05", + 80 + ], + [ + "2016-02-06", + 105 + ], + [ + "2016-02-07", + 18 + ], + [ + "2016-02-08", + 93 + ], + [ + "2016-02-09", + 133 + ], + [ + "2016-02-10", + 103 + ], + [ + "2016-02-11", + 138 + ], + [ + "2016-02-12", + 88 + ], + [ + "2016-02-13", + 128 + ], + [ + "2016-02-14", + 56 + ], + [ + "2016-02-15", + 68 + ], + [ + "2016-02-16", + 47 + ], + [ + "2016-02-17", + 110 + ], + [ + "2016-02-18", + 98 + ], + [ + "2016-02-19", + 313 + ], + [ + "2016-02-20", + 125 + ], + [ + "2016-02-21", + 40 + ], + [ + "2016-02-22", + 105 + ], + [ + "2016-02-23", + 33 + ], + [ + "2016-02-24", + 103 + ], + [ + "2016-02-25", + 178 + ], + [ + "2016-02-26", + 192 + ], + [ + "2016-02-27", + 104 + ], + [ + "2016-02-28", + 54 + ], + [ + "2016-02-29", + 108 + ], + [ + "2016-03-01", + 122 + ], + [ + "2016-03-02", + 104 + ], + [ + "2016-03-03", + 240 + ], + [ + "2016-03-04", + 74 + ], + [ + "2016-03-05", + 51 + ], + [ + "2016-03-06", + 27 + ], + [ + "2016-03-07", + 103 + ], + [ + "2016-03-08", + 55 + ], + [ + "2016-03-09", + 79 + ], + [ + "2016-03-10", + 113 + ], + [ + "2016-03-11", + 60 + ], + [ + "2016-03-12", + 8 + ], + [ + "2016-03-13", + 21 + ], + [ + "2016-03-14", + 73 + ], + [ + "2016-03-15", + 91 + ], + [ + "2016-03-16", + 90 + ], + [ + "2016-03-17", + 67 + ], + [ + "2016-03-18", + 107 + ], + [ + "2016-03-19", + 79 + ], + [ + "2016-03-20", + 53 + ], + [ + "2016-03-21", + 129 + ], + [ + "2016-03-22", + 201 + ], + [ + "2016-03-23", + 112 + ], + [ + "2016-03-24", + 92 + ], + [ + "2016-03-25", + 100 + ], + [ + "2016-03-26", + 76 + ], + [ + "2016-03-27", + 25 + ], + [ + "2016-03-28", + 29 + ], + [ + "2016-03-29", + 131 + ], + [ + "2016-03-30", + 158 + ], + [ + "2016-03-31", + 186 + ], + [ + "2016-04-01", + 47 + ], + [ + "2016-04-02", + 53 + ], + [ + "2016-04-03", + 45 + ], + [ + "2016-04-04", + 85 + ], + [ + "2016-04-05", + 93 + ], + [ + "2016-04-06", + 38 + ], + [ + "2016-04-07", + 40 + ], + [ + "2016-04-08", + 60 + ], + [ + "2016-04-09", + 74 + ], + [ + "2016-04-10", + 28 + ], + [ + "2016-04-11", + 119 + ], + [ + "2016-04-12", + 55 + ], + [ + "2016-04-13", + 138 + ], + [ + "2016-04-14", + 45 + ], + [ + "2016-04-15", + 115 + ], + [ + "2016-04-16", + 40 + ], + [ + "2016-04-17", + 7 + ], + [ + "2016-04-18", + 74 + ], + [ + "2016-04-19", + 46 + ], + [ + "2016-04-20", + 156 + ], + [ + "2016-04-21", + 160 + ], + [ + "2016-04-22", + 65 + ], + [ + "2016-04-23", + 4 + ], + [ + "2016-04-24", + 77 + ], + [ + "2016-04-25", + 127 + ], + [ + "2016-04-26", + 64 + ], + [ + "2016-04-27", + 153 + ], + [ + "2016-04-28", + 78 + ], + [ + "2016-04-29", + 43 + ], + [ + "2016-04-30", + 115 + ], + [ + "2016-05-01", + 80 + ], + [ + "2016-05-02", + 110 + ], + [ + "2016-05-03", + 55 + ], + [ + "2016-05-04", + 31 + ], + [ + "2016-05-05", + 22 + ], + [ + "2016-05-06", + 21 + ], + [ + "2016-05-07", + 33 + ], + [ + "2016-05-08", + 47 + ], + [ + "2016-05-09", + 113 + ], + [ + "2016-05-10", + 262 + ], + [ + "2016-05-11", + 43 + ], + [ + "2016-05-12", + 114 + ], + [ + "2016-05-13", + 115 + ], + [ + "2016-05-14", + 102 + ], + [ + "2016-05-15", + 69 + ], + [ + "2016-05-16", + 99 + ], + [ + "2016-05-17", + 318 + ], + [ + "2016-05-18", + 215 + ], + [ + "2016-05-19", + 57 + ], + [ + "2016-05-20", + 108 + ], + [ + "2016-05-21", + 16 + ], + [ + "2016-05-22", + 62 + ], + [ + "2016-05-23", + 71 + ], + [ + "2016-05-24", + 69 + ], + [ + "2016-05-25", + 92 + ], + [ + "2016-05-26", + 149 + ], + [ + "2016-05-27", + 27 + ], + [ + "2016-05-28", + 21 + ], + [ + "2016-05-29", + 71 + ], + [ + "2016-05-30", + 89 + ], + [ + "2016-05-31", + 156 + ], + [ + "2016-06-01", + 32 + ], + [ + "2016-06-02", + 76 + ], + [ + "2016-06-03", + 174 + ], + [ + "2016-06-04", + 50 + ], + [ + "2016-06-05", + 18 + ], + [ + "2016-06-06", + 141 + ], + [ + "2016-06-07", + 70 + ], + [ + "2016-06-08", + 34 + ], + [ + "2016-06-09", + 91 + ], + [ + "2016-06-10", + 88 + ], + [ + "2016-06-11", + 80 + ], + [ + "2016-06-12", + 17 + ], + [ + "2016-06-13", + 67 + ], + [ + "2016-06-14", + 131 + ], + [ + "2016-06-15", + 127 + ], + [ + "2016-06-16", + 50 + ], + [ + "2016-06-17", + 32 + ], + [ + "2016-06-18", + 117 + ], + [ + "2016-06-19", + 49 + ], + [ + "2016-06-20", + 74 + ], + [ + "2016-06-21", + 171 + ], + [ + "2016-06-22", + 292 + ], + [ + "2016-06-23", + 95 + ], + [ + "2016-06-24", + 43 + ], + [ + "2016-06-25", + 4 + ], + [ + "2016-06-26", + 92 + ], + [ + "2016-06-27", + 109 + ], + [ + "2016-06-28", + 143 + ], + [ + "2016-06-29", + 165 + ], + [ + "2016-06-30", + 84 + ], + [ + "2016-07-01", + 96 + ], + [ + "2016-07-02", + 43 + ], + [ + "2016-07-03", + 6 + ], + [ + "2016-07-04", + 38 + ], + [ + "2016-07-05", + 99 + ], + [ + "2016-07-06", + 69 + ], + [ + "2016-07-07", + 70 + ], + [ + "2016-07-08", + 133 + ], + [ + "2016-07-09", + 33 + ], + [ + "2016-07-10", + 70 + ], + [ + "2016-07-11", + 17 + ], + [ + "2016-07-12", + 213 + ], + [ + "2016-07-13", + 104 + ], + [ + "2016-07-14", + 142 + ], + [ + "2016-07-15", + 170 + ], + [ + "2016-07-16", + 17 + ], + [ + "2016-07-17", + 49 + ], + [ + "2016-07-18", + 194 + ], + [ + "2016-07-19", + 171 + ], + [ + "2016-07-20", + 128 + ], + [ + "2016-07-21", + 71 + ], + [ + "2016-07-22", + 62 + ], + [ + "2016-07-23", + 43 + ], + [ + "2016-07-24", + 5 + ], + [ + "2016-07-25", + 207 + ], + [ + "2016-07-26", + 113 + ], + [ + "2016-07-27", + 124 + ], + [ + "2016-07-28", + 270 + ], + [ + "2016-07-29", + 59 + ], + [ + "2016-07-30", + 97 + ], + [ + "2016-07-31", + 150 + ], + [ + "2016-08-01", + 112 + ], + [ + "2016-08-02", + 19 + ], + [ + "2016-08-03", + 145 + ], + [ + "2016-08-04", + 227 + ], + [ + "2016-08-05", + 501 + ], + [ + "2016-08-06", + 71 + ], + [ + "2016-08-07", + 56 + ], + [ + "2016-08-08", + 150 + ], + [ + "2016-08-09", + 122 + ], + [ + "2016-08-10", + 175 + ], + [ + "2016-08-11", + 226 + ], + [ + "2016-08-12", + 30 + ], + [ + "2016-08-13", + 71 + ], + [ + "2016-08-14", + 116 + ], + [ + "2016-08-15", + 33 + ], + [ + "2016-08-16", + 107 + ], + [ + "2016-08-17", + 139 + ], + [ + "2016-08-18", + 129 + ], + [ + "2016-08-19", + 155 + ], + [ + "2016-08-20", + 78 + ], + [ + "2016-08-21", + 65 + ], + [ + "2016-08-22", + 119 + ], + [ + "2016-08-23", + 169 + ], + [ + "2016-08-24", + 186 + ], + [ + "2016-08-25", + 35 + ], + [ + "2016-08-26", + 194 + ], + [ + "2016-08-27", + 133 + ], + [ + "2016-08-28", + 6 + ], + [ + "2016-08-29", + 146 + ], + [ + "2016-08-30", + 164 + ], + [ + "2016-08-31", + 232 + ], + [ + "2016-09-01", + 125 + ], + [ + "2016-09-02", + 109 + ], + [ + "2016-09-03", + 4 + ], + [ + "2016-09-04", + 23 + ], + [ + "2016-09-05", + 234 + ], + [ + "2016-09-06", + 186 + ], + [ + "2016-09-07", + 120 + ], + [ + "2016-09-08", + 98 + ], + [ + "2016-09-09", + 244 + ], + [ + "2016-09-10", + 30 + ], + [ + "2016-09-11", + 37 + ], + [ + "2016-09-12", + 102 + ], + [ + "2016-09-13", + 93 + ], + [ + "2016-09-14", + 58 + ], + [ + "2016-09-15", + 98 + ], + [ + "2016-09-16", + 110 + ], + [ + "2016-09-17", + 33 + ], + [ + "2016-09-18", + 20 + ], + [ + "2016-09-19", + 34 + ], + [ + "2016-09-20", + 67 + ], + [ + "2016-09-21", + 42 + ], + [ + "2016-09-22", + 113 + ], + [ + "2016-09-23", + 40 + ], + [ + "2016-09-24", + 116 + ], + [ + "2016-09-25", + 9 + ], + [ + "2016-09-26", + 95 + ], + [ + "2016-09-27", + 183 + ], + [ + "2016-09-28", + 104 + ], + [ + "2016-09-29", + 93 + ], + [ + "2016-09-30", + 63 + ], + [ + "2016-10-01", + 66 + ], + [ + "2016-10-02", + 80 + ], + [ + "2016-10-03", + 58 + ], + [ + "2016-10-04", + 170 + ], + [ + "2016-10-05", + 112 + ], + [ + "2016-10-06", + 88 + ], + [ + "2016-10-07", + 102 + ], + [ + "2016-10-08", + 159 + ], + [ + "2016-10-09", + 43 + ], + [ + "2016-10-10", + 103 + ], + [ + "2016-10-11", + 125 + ], + [ + "2016-10-12", + 101 + ], + [ + "2016-10-13", + 204 + ], + [ + "2016-10-14", + 121 + ], + [ + "2016-10-15", + 114 + ], + [ + "2016-10-16", + 83 + ], + [ + "2016-10-17", + 102 + ], + [ + "2016-10-18", + 391 + ], + [ + "2016-10-19", + 260 + ], + [ + "2016-10-20", + 69 + ], + [ + "2016-10-21", + 189 + ], + [ + "2016-10-22", + 48 + ], + [ + "2016-10-23", + 49 + ], + [ + "2016-10-24", + 125 + ], + [ + "2016-10-25", + 140 + ], + [ + "2016-10-26", + 122 + ], + [ + "2016-10-27", + 165 + ], + [ + "2016-10-28", + 81 + ], + [ + "2016-10-29", + 29 + ], + [ + "2016-10-30", + 81 + ], + [ + "2016-10-31", + 100 + ], + [ + "2016-11-01", + 121 + ], + [ + "2016-11-02", + 6 + ], + [ + "2016-11-03", + 212 + ], + [ + "2016-11-04", + 94 + ], + [ + "2016-11-05", + 48 + ], + [ + "2016-11-06", + 8 + ], + [ + "2016-11-07", + 93 + ], + [ + "2016-11-08", + 71 + ], + [ + "2016-11-09", + 21 + ], + [ + "2016-11-10", + 61 + ], + [ + "2016-11-11", + 100 + ], + [ + "2016-11-12", + 19 + ], + [ + "2016-11-13", + 77 + ], + [ + "2016-11-14", + 105 + ], + [ + "2016-11-15", + 107 + ], + [ + "2016-11-16", + 82 + ], + [ + "2016-11-17", + 102 + ], + [ + "2016-11-18", + 109 + ], + [ + "2016-11-19", + 84 + ], + [ + "2016-11-20", + 37 + ], + [ + "2016-11-21", + 88 + ], + [ + "2016-11-22", + 16 + ], + [ + "2016-11-23", + 163 + ], + [ + "2016-11-24", + 85 + ], + [ + "2016-11-25", + 78 + ], + [ + "2016-11-26", + 47 + ], + [ + "2016-11-27", + 16 + ], + [ + "2016-11-28", + 108 + ], + [ + "2016-11-29", + 16 + ], + [ + "2016-11-30", + 68 + ], + [ + "2016-12-01", + 30 + ], + [ + "2016-12-02", + 39 + ], + [ + "2016-12-03", + 47 + ], + [ + "2016-12-04", + 81 + ], + [ + "2016-12-05", + 105 + ], + [ + "2016-12-06", + 109 + ], + [ + "2016-12-07", + 77 + ], + [ + "2016-12-08", + 10 + ], + [ + "2016-12-09", + 51 + ], + [ + "2016-12-10", + 112 + ], + [ + "2016-12-11", + 38 + ], + [ + "2016-12-12", + 146 + ], + [ + "2016-12-13", + 96 + ], + [ + "2016-12-14", + 32 + ], + [ + "2016-12-15", + 109 + ], + [ + "2016-12-16", + 59 + ], + [ + "2016-12-17", + 61 + ], + [ + "2016-12-18", + 20 + ], + [ + "2016-12-19", + 286 + ], + [ + "2016-12-20", + 69 + ], + [ + "2016-12-21", + 74 + ], + [ + "2016-12-22", + 131 + ], + [ + "2016-12-23", + 82 + ], + [ + "2016-12-24", + 3 + ], + [ + "2016-12-25", + 44 + ], + [ + "2016-12-26", + 46 + ], + [ + "2016-12-27", + 51 + ], + [ + "2016-12-28", + 114 + ], + [ + "2016-12-29", + 72 + ], + [ + "2016-12-30", + 76 + ], + [ + "2016-12-31", + 23 + ], + [ + "2017-01-01", + 80 + ], + [ + "2017-01-02", + 109 + ], + [ + "2017-01-03", + 238 + ], + [ + "2017-01-04", + 155 + ], + [ + "2017-01-05", + 91 + ], + [ + "2017-01-06", + 36 + ], + [ + "2017-01-07", + 146 + ], + [ + "2017-01-08", + 20 + ], + [ + "2017-01-09", + 120 + ], + [ + "2017-01-10", + 154 + ], + [ + "2017-01-11", + 176 + ], + [ + "2017-01-12", + 70 + ], + [ + "2017-01-13", + 121 + ], + [ + "2017-01-14", + 28 + ], + [ + "2017-01-15", + 106 + ], + [ + "2017-01-16", + 164 + ], + [ + "2017-01-17", + 166 + ], + [ + "2017-01-18", + 205 + ], + [ + "2017-01-19", + 278 + ], + [ + "2017-01-20", + 78 + ], + [ + "2017-01-21", + 32 + ], + [ + "2017-01-22", + 61 + ], + [ + "2017-01-23", + 171 + ], + [ + "2017-01-24", + 241 + ], + [ + "2017-01-25", + 40 + ], + [ + "2017-01-26", + 31 + ], + [ + "2017-01-27", + 92 + ], + [ + "2017-01-28", + 514 + ], + [ + "2017-01-29", + 103 + ], + [ + "2017-01-30", + 196 + ], + [ + "2017-01-31", + 328 + ], + [ + "2017-02-01", + 160 + ], + [ + "2017-02-02", + 165 + ], + [ + "2017-02-03", + 64 + ], + [ + "2017-02-04", + 173 + ], + [ + "2017-02-05", + 83 + ], + [ + "2017-02-06", + 104 + ], + [ + "2017-02-07", + 118 + ], + [ + "2017-02-08", + 55 + ], + [ + "2017-02-09", + 203 + ], + [ + "2017-02-10", + 11 + ], + [ + "2017-02-11", + 14 + ], + [ + "2017-02-12", + 103 + ], + [ + "2017-02-13", + 70 + ], + [ + "2017-02-14", + 145 + ], + [ + "2017-02-15", + 71 + ], + [ + "2017-02-16", + 68 + ], + [ + "2017-02-17", + 26 + ], + [ + "2017-02-18", + 85 + ], + [ + "2017-02-19", + 74 + ], + [ + "2017-02-20", + 37 + ], + [ + "2017-02-21", + 133 + ], + [ + "2017-02-22", + 153 + ], + [ + "2017-02-23", + 146 + ], + [ + "2017-02-24", + 55 + ], + [ + "2017-02-25", + 88 + ], + [ + "2017-02-26", + 30 + ], + [ + "2017-02-27", + 192 + ], + [ + "2017-02-28", + 41 + ], + [ + "2017-03-01", + 223 + ], + [ + "2017-03-02", + 187 + ], + [ + "2017-03-03", + 38 + ], + [ + "2017-03-04", + 31 + ], + [ + "2017-03-05", + 41 + ], + [ + "2017-03-06", + 40 + ], + [ + "2017-03-07", + 69 + ], + [ + "2017-03-08", + 228 + ], + [ + "2017-03-09", + 100 + ], + [ + "2017-03-10", + 113 + ], + [ + "2017-03-11", + 48 + ], + [ + "2017-03-12", + 11 + ], + [ + "2017-03-13", + 97 + ], + [ + "2017-03-14", + 77 + ], + [ + "2017-03-15", + 77 + ], + [ + "2017-03-16", + 11 + ], + [ + "2017-03-17", + 164 + ], + [ + "2017-03-18", + 6 + ], + [ + "2017-03-19", + 45 + ], + [ + "2017-03-20", + 87 + ], + [ + "2017-03-21", + 71 + ], + [ + "2017-03-22", + 188 + ], + [ + "2017-03-23", + 166 + ], + [ + "2017-03-24", + 18 + ], + [ + "2017-03-25", + 90 + ], + [ + "2017-03-26", + 17 + ], + [ + "2017-03-27", + 99 + ], + [ + "2017-03-28", + 184 + ], + [ + "2017-03-29", + 56 + ], + [ + "2017-03-30", + 109 + ], + [ + "2017-03-31", + 692 + ], + [ + "2017-04-01", + 358 + ], + [ + "2017-04-02", + 87 + ], + [ + "2017-04-03", + 154 + ], + [ + "2017-04-04", + 174 + ], + [ + "2017-04-05", + 90 + ], + [ + "2017-04-06", + 46 + ], + [ + "2017-04-07", + 113 + ], + [ + "2017-04-08", + 67 + ], + [ + "2017-04-09", + 34 + ], + [ + "2017-04-10", + 105 + ], + [ + "2017-04-11", + 94 + ], + [ + "2017-04-12", + 205 + ], + [ + "2017-04-13", + 145 + ], + [ + "2017-04-14", + 90 + ], + [ + "2017-04-15", + 116 + ], + [ + "2017-04-16", + 46 + ], + [ + "2017-04-17", + 111 + ], + [ + "2017-04-18", + 182 + ], + [ + "2017-04-19", + 425 + ], + [ + "2017-04-20", + 128 + ], + [ + "2017-04-21", + 213 + ], + [ + "2017-04-22", + 60 + ], + [ + "2017-04-23", + 59 + ], + [ + "2017-04-24", + 74 + ], + [ + "2017-04-25", + 121 + ], + [ + "2017-04-26", + 393 + ], + [ + "2017-04-27", + 102 + ], + [ + "2017-04-28", + 30 + ], + [ + "2017-04-29", + 46 + ], + [ + "2017-04-30", + 109 + ], + [ + "2017-05-01", + 131 + ], + [ + "2017-05-02", + 74 + ], + [ + "2017-05-03", + 113 + ], + [ + "2017-05-04", + 91 + ], + [ + "2017-05-05", + 20 + ], + [ + "2017-05-06", + 58 + ], + [ + "2017-05-07", + 25 + ], + [ + "2017-05-08", + 66 + ], + [ + "2017-05-09", + 100 + ], + [ + "2017-05-10", + 222 + ], + [ + "2017-05-11", + 82 + ], + [ + "2017-05-12", + 121 + ], + [ + "2017-05-13", + 36 + ], + [ + "2017-05-14", + 33 + ], + [ + "2017-05-15", + 70 + ], + [ + "2017-05-16", + 76 + ], + [ + "2017-05-17", + 49 + ], + [ + "2017-05-18", + 105 + ], + [ + "2017-05-19", + 209 + ], + [ + "2017-05-20", + 23 + ], + [ + "2017-05-21", + 28 + ], + [ + "2017-05-22", + 24 + ], + [ + "2017-05-23", + 78 + ], + [ + "2017-05-24", + 41 + ], + [ + "2017-05-25", + 169 + ], + [ + "2017-05-26", + 28 + ], + [ + "2017-05-27", + 79 + ], + [ + "2017-05-28", + 19 + ], + [ + "2017-05-29", + 97 + ], + [ + "2017-05-30", + 257 + ], + [ + "2017-05-31", + 54 + ], + [ + "2017-06-01", + 109 + ], + [ + "2017-06-02", + 12 + ], + [ + "2017-06-03", + 18 + ], + [ + "2017-06-04", + 11 + ], + [ + "2017-06-05", + 81 + ], + [ + "2017-06-06", + 182 + ], + [ + "2017-06-07", + 149 + ], + [ + "2017-06-08", + 82 + ], + [ + "2017-06-09", + 6 + ], + [ + "2017-06-10", + 64 + ], + [ + "2017-06-11", + 30 + ], + [ + "2017-06-12", + 50 + ], + [ + "2017-06-13", + 576 + ], + [ + "2017-06-14", + 171 + ], + [ + "2017-06-15", + 156 + ], + [ + "2017-06-16", + 133 + ], + [ + "2017-06-17", + 121 + ], + [ + "2017-06-18", + 36 + ], + [ + "2017-06-19", + 83 + ], + [ + "2017-06-20", + 141 + ], + [ + "2017-06-21", + 119 + ], + [ + "2017-06-22", + 148 + ], + [ + "2017-06-23", + 83 + ], + [ + "2017-06-24", + 157 + ], + [ + "2017-06-25", + 32 + ], + [ + "2017-06-26", + 236 + ], + [ + "2017-06-27", + 109 + ], + [ + "2017-06-28", + 147 + ], + [ + "2017-06-29", + 117 + ], + [ + "2017-06-30", + 95 + ], + [ + "2017-07-01", + 23 + ], + [ + "2017-07-02", + 16 + ], + [ + "2017-07-03", + 40 + ], + [ + "2017-07-04", + 55 + ], + [ + "2017-07-05", + 164 + ], + [ + "2017-07-06", + 44 + ], + [ + "2017-07-07", + 172 + ], + [ + "2017-07-08", + 35 + ], + [ + "2017-07-09", + 25 + ], + [ + "2017-07-10", + 78 + ], + [ + "2017-07-11", + 118 + ], + [ + "2017-07-12", + 149 + ], + [ + "2017-07-13", + 31 + ], + [ + "2017-07-14", + 29 + ], + [ + "2017-07-15", + 45 + ], + [ + "2017-07-16", + 74 + ], + [ + "2017-07-17", + 50 + ], + [ + "2017-07-18", + 114 + ], + [ + "2017-07-19", + 206 + ], + [ + "2017-07-20", + 82 + ], + [ + "2017-07-21", + 148 + ], + [ + "2017-07-22", + 67 + ], + [ + "2017-07-23", + 17 + ], + [ + "2017-07-24", + 158 + ], + [ + "2017-07-25", + 52 + ], + [ + "2017-07-26", + 96 + ], + [ + "2017-07-27", + 84 + ], + [ + "2017-07-28", + 32 + ], + [ + "2017-07-29", + 70 + ], + [ + "2017-07-30", + 30 + ], + [ + "2017-07-31", + 55 + ], + [ + "2017-08-01", + 67 + ], + [ + "2017-08-02", + 78 + ], + [ + "2017-08-03", + 56 + ], + [ + "2017-08-04", + 208 + ], + [ + "2017-08-05", + 37 + ], + [ + "2017-08-06", + 22 + ], + [ + "2017-08-07", + 86 + ], + [ + "2017-08-08", + 104 + ], + [ + "2017-08-09", + 49 + ], + [ + "2017-08-10", + 50 + ], + [ + "2017-08-11", + 57 + ], + [ + "2017-08-12", + 77 + ], + [ + "2017-08-13", + 52 + ], + [ + "2017-08-14", + 77 + ], + [ + "2017-08-15", + 129 + ], + [ + "2017-08-16", + 90 + ], + [ + "2017-08-17", + 164 + ], + [ + "2017-08-18", + 26 + ], + [ + "2017-08-19", + 31 + ], + [ + "2017-08-20", + 29 + ], + [ + "2017-08-21", + 85 + ], + [ + "2017-08-22", + 179 + ], + [ + "2017-08-23", + 55 + ], + [ + "2017-08-24", + 54 + ], + [ + "2017-08-25", + 22 + ], + [ + "2017-08-26", + 138 + ], + [ + "2017-08-27", + 45 + ], + [ + "2017-08-28", + 127 + ], + [ + "2017-08-29", + 67 + ], + [ + "2017-08-30", + 115 + ], + [ + "2017-08-31", + 60 + ], + [ + "2017-09-01", + 142 + ], + [ + "2017-09-02", + 64 + ], + [ + "2017-09-03", + 191 + ], + [ + "2017-09-04", + 64 + ], + [ + "2017-09-05", + 58 + ], + [ + "2017-09-06", + 75 + ], + [ + "2017-09-07", + 26 + ], + [ + "2017-09-08", + 42 + ], + [ + "2017-09-09", + 27 + ], + [ + "2017-09-10", + 12 + ], + [ + "2017-09-11", + 32 + ], + [ + "2017-09-12", + 72 + ], + [ + "2017-09-13", + 158 + ], + [ + "2017-09-14", + 45 + ], + [ + "2017-09-15", + 36 + ], + [ + "2017-09-16", + 8 + ], + [ + "2017-09-17", + 69 + ], + [ + "2017-09-18", + 161 + ], + [ + "2017-09-19", + 19 + ], + [ + "2017-09-20", + 97 + ], + [ + "2017-09-21", + 91 + ], + [ + "2017-09-22", + 20 + ], + [ + "2017-09-23", + 47 + ], + [ + "2017-09-24", + 32 + ], + [ + "2017-09-25", + 26 + ], + [ + "2017-09-26", + 27 + ], + [ + "2017-09-27", + 258 + ], + [ + "2017-09-28", + 96 + ], + [ + "2017-09-29", + 108 + ], + [ + "2017-09-30", + 17 + ], + [ + "2017-10-01", + 35 + ], + [ + "2017-10-02", + 43 + ], + [ + "2017-10-03", + 72 + ], + [ + "2017-10-04", + 22 + ], + [ + "2017-10-05", + 27 + ], + [ + "2017-10-06", + 84 + ], + [ + "2017-10-07", + 59 + ], + [ + "2017-10-08", + 75 + ], + [ + "2017-10-09", + 66 + ], + [ + "2017-10-10", + 37 + ], + [ + "2017-10-11", + 45 + ], + [ + "2017-10-12", + 184 + ], + [ + "2017-10-13", + 185 + ], + [ + "2017-10-14", + 125 + ], + [ + "2017-10-15", + 121 + ], + [ + "2017-10-16", + 116 + ], + [ + "2017-10-17", + 183 + ], + [ + "2017-10-18", + 154 + ], + [ + "2017-10-19", + 284 + ], + [ + "2017-10-20", + 98 + ], + [ + "2017-10-21", + 41 + ], + [ + "2017-10-22", + 95 + ], + [ + "2017-10-23", + 237 + ], + [ + "2017-10-24", + 127 + ], + [ + "2017-10-25", + 160 + ], + [ + "2017-10-26", + 74 + ], + [ + "2017-10-27", + 101 + ], + [ + "2017-10-28", + 60 + ], + [ + "2017-10-29", + 35 + ], + [ + "2017-10-30", + 202 + ], + [ + "2017-10-31", + 218 + ], + [ + "2017-11-01", + 187 + ], + [ + "2017-11-02", + 93 + ], + [ + "2017-11-03", + 190 + ], + [ + "2017-11-04", + 23 + ], + [ + "2017-11-05", + 118 + ], + [ + "2017-11-06", + 347 + ], + [ + "2017-11-07", + 139 + ], + [ + "2017-11-08", + 244 + ], + [ + "2017-11-09", + 199 + ], + [ + "2017-11-10", + 145 + ], + [ + "2017-11-11", + 70 + ], + [ + "2017-11-12", + 152 + ], + [ + "2017-11-13", + 120 + ], + [ + "2017-11-14", + 185 + ], + [ + "2017-11-15", + 61 + ], + [ + "2017-11-16", + 98 + ], + [ + "2017-11-17", + 104 + ], + [ + "2017-11-18", + 2 + ], + [ + "2017-11-19", + 65 + ], + [ + "2017-11-20", + 194 + ], + [ + "2017-11-21", + 153 + ], + [ + "2017-11-22", + 102 + ], + [ + "2017-11-23", + 56 + ], + [ + "2017-11-24", + 107 + ], + [ + "2017-11-25", + 62 + ], + [ + "2017-11-26", + 40 + ], + [ + "2017-11-27", + 53 + ], + [ + "2017-11-28", + 83 + ], + [ + "2017-11-29", + 150 + ], + [ + "2017-11-30", + 147 + ], + [ + "2017-12-01", + 169 + ], + [ + "2017-12-02", + 44 + ], + [ + "2017-12-03", + 48 + ], + [ + "2017-12-04", + 118 + ], + [ + "2017-12-05", + 184 + ], + [ + "2017-12-06", + 297 + ], + [ + "2017-12-07", + 244 + ], + [ + "2017-12-08", + 213 + ], + [ + "2017-12-09", + 37 + ], + [ + "2017-12-10", + 30 + ], + [ + "2017-12-11", + 209 + ], + [ + "2017-12-12", + 102 + ], + [ + "2017-12-13", + 92 + ], + [ + "2017-12-14", + 140 + ], + [ + "2017-12-15", + 57 + ], + [ + "2017-12-16", + 2 + ], + [ + "2017-12-17", + 53 + ], + [ + "2017-12-18", + 76 + ], + [ + "2017-12-19", + 37 + ], + [ + "2017-12-20", + 60 + ], + [ + "2017-12-21", + 82 + ], + [ + "2017-12-22", + 127 + ], + [ + "2017-12-23", + 97 + ], + [ + "2017-12-24", + 68 + ], + [ + "2017-12-25", + 4 + ], + [ + "2017-12-26", + 38 + ], + [ + "2017-12-27", + 73 + ], + [ + "2017-12-28", + 130 + ], + [ + "2017-12-29", + 120 + ], + [ + "2017-12-30", + 59 + ], + [ + "2017-12-31", + 141 + ], + [ + "2018-01-01", + 168 + ], + [ + "2018-01-02", + 170 + ], + [ + "2018-01-03", + 219 + ], + [ + "2018-01-04", + 55 + ], + [ + "2018-01-05", + 112 + ], + [ + "2018-01-06", + 53 + ], + [ + "2018-01-07", + 49 + ], + [ + "2018-01-08", + 82 + ], + [ + "2018-01-09", + 173 + ], + [ + "2018-01-10", + 107 + ], + [ + "2018-01-11", + 92 + ], + [ + "2018-01-12", + 211 + ], + [ + "2018-01-13", + 160 + ], + [ + "2018-01-14", + 14 + ], + [ + "2018-01-15", + 73 + ], + [ + "2018-01-16", + 179 + ], + [ + "2018-01-17", + 106 + ], + [ + "2018-01-18", + 90 + ], + [ + "2018-01-19", + 74 + ], + [ + "2018-01-20", + 149 + ], + [ + "2018-01-21", + 109 + ], + [ + "2018-01-22", + 82 + ], + [ + "2018-01-23", + 206 + ], + [ + "2018-01-24", + 65 + ], + [ + "2018-01-25", + 122 + ], + [ + "2018-01-26", + 131 + ], + [ + "2018-01-27", + 34 + ], + [ + "2018-01-28", + 53 + ], + [ + "2018-01-29", + 100 + ], + [ + "2018-01-30", + 104 + ], + [ + "2018-01-31", + 149 + ], + [ + "2018-02-01", + 56 + ], + [ + "2018-02-02", + 5 + ], + [ + "2018-02-03", + 31 + ], + [ + "2018-02-04", + 72 + ], + [ + "2018-02-05", + 79 + ], + [ + "2018-02-06", + 56 + ], + [ + "2018-02-07", + 158 + ], + [ + "2018-02-08", + 207 + ], + [ + "2018-02-09", + 128 + ], + [ + "2018-02-10", + 34 + ], + [ + "2018-02-11", + 105 + ], + [ + "2018-02-12", + 91 + ], + [ + "2018-02-13", + 96 + ], + [ + "2018-02-14", + 133 + ], + [ + "2018-02-15", + 203 + ], + [ + "2018-02-16", + 49 + ], + [ + "2018-02-17", + 42 + ], + [ + "2018-02-18", + 34 + ], + [ + "2018-02-19", + 122 + ], + [ + "2018-02-20", + 141 + ], + [ + "2018-02-21", + 111 + ], + [ + "2018-02-22", + 144 + ], + [ + "2018-02-23", + 132 + ], + [ + "2018-02-24", + 53 + ], + [ + "2018-02-25", + 44 + ], + [ + "2018-02-26", + 142 + ], + [ + "2018-02-27", + 154 + ], + [ + "2018-02-28", + 75 + ], + [ + "2018-03-01", + 194 + ], + [ + "2018-03-02", + 160 + ], + [ + "2018-03-03", + 33 + ], + [ + "2018-03-04", + 43 + ], + [ + "2018-03-05", + 150 + ], + [ + "2018-03-06", + 165 + ], + [ + "2018-03-07", + 187 + ], + [ + "2018-03-08", + 132 + ], + [ + "2018-03-09", + 38 + ], + [ + "2018-03-10", + 100 + ], + [ + "2018-03-11", + 73 + ], + [ + "2018-03-12", + 644 + ], + [ + "2018-03-13", + 945 + ], + [ + "2018-03-14", + 734 + ], + [ + "2018-03-15", + 315 + ], + [ + "2018-03-16", + 184 + ], + [ + "2018-03-17", + 70 + ], + [ + "2018-03-18", + 83 + ], + [ + "2018-03-19", + 1699 + ], + [ + "2018-03-20", + 1241 + ], + [ + "2018-03-21", + 265 + ], + [ + "2018-03-22", + 179 + ], + [ + "2018-03-23", + 114 + ], + [ + "2018-03-24", + 24 + ], + [ + "2018-03-25", + 56 + ], + [ + "2018-03-26", + 177 + ], + [ + "2018-03-27", + 332 + ], + [ + "2018-03-28", + 213 + ], + [ + "2018-03-29", + 58 + ], + [ + "2018-03-30", + 157 + ], + [ + "2018-03-31", + 35 + ], + [ + "2018-04-01", + 27 + ], + [ + "2018-04-02", + 30 + ], + [ + "2018-04-03", + 113 + ], + [ + "2018-04-04", + 65 + ], + [ + "2018-04-05", + 168 + ], + [ + "2018-04-06", + 250 + ], + [ + "2018-04-07", + 64 + ], + [ + "2018-04-08", + 76 + ], + [ + "2018-04-09", + 101 + ], + [ + "2018-04-10", + 218 + ], + [ + "2018-04-11", + 233 + ], + [ + "2018-04-12", + 116 + ], + [ + "2018-04-13", + 74 + ], + [ + "2018-04-14", + 73 + ], + [ + "2018-04-15", + 18 + ], + [ + "2018-04-16", + 36 + ], + [ + "2018-04-17", + 140 + ], + [ + "2018-04-18", + 54 + ], + [ + "2018-04-19", + 77 + ], + [ + "2018-04-20", + 103 + ], + [ + "2018-04-21", + 48 + ], + [ + "2018-04-22", + 36 + ], + [ + "2018-04-23", + 83 + ], + [ + "2018-04-24", + 149 + ], + [ + "2018-04-25", + 86 + ], + [ + "2018-04-26", + 34 + ], + [ + "2018-04-27", + 124 + ], + [ + "2018-04-28", + 15 + ], + [ + "2018-04-29", + 64 + ], + [ + "2018-04-30", + 27 + ], + [ + "2018-05-01", + 223 + ], + [ + "2018-05-02", + 276 + ], + [ + "2018-05-03", + 205 + ], + [ + "2018-05-04", + 112 + ], + [ + "2018-05-05", + 67 + ], + [ + "2018-05-06", + 115 + ], + [ + "2018-05-07", + 138 + ], + [ + "2018-05-08", + 89 + ], + [ + "2018-05-09", + 121 + ], + [ + "2018-05-10", + 41 + ], + [ + "2018-05-11", + 30 + ], + [ + "2018-05-12", + 59 + ], + [ + "2018-05-13", + 47 + ], + [ + "2018-05-14", + 145 + ], + [ + "2018-05-15", + 19 + ], + [ + "2018-05-16", + 171 + ], + [ + "2018-05-17", + 143 + ], + [ + "2018-05-18", + 62 + ], + [ + "2018-05-19", + 110 + ], + [ + "2018-05-20", + 64 + ], + [ + "2018-05-21", + 75 + ], + [ + "2018-05-22", + 89 + ], + [ + "2018-05-23", + 82 + ], + [ + "2018-05-24", + 84 + ], + [ + "2018-05-25", + 100 + ], + [ + "2018-05-26", + 131 + ], + [ + "2018-05-27", + 70 + ], + [ + "2018-05-28", + 268 + ], + [ + "2018-05-29", + 85 + ], + [ + "2018-05-30", + 158 + ], + [ + "2018-05-31", + 117 + ], + [ + "2018-06-01", + 137 + ], + [ + "2018-06-02", + 48 + ], + [ + "2018-06-03", + 76 + ], + [ + "2018-06-04", + 197 + ], + [ + "2018-06-05", + 151 + ], + [ + "2018-06-06", + 124 + ], + [ + "2018-06-07", + 102 + ], + [ + "2018-06-08", + 141 + ], + [ + "2018-06-09", + 97 + ], + [ + "2018-06-10", + 80 + ], + [ + "2018-06-11", + 190 + ], + [ + "2018-06-12", + 75 + ], + [ + "2018-06-13", + 101 + ], + [ + "2018-06-14", + 124 + ], + [ + "2018-06-15", + 188 + ], + [ + "2018-06-16", + 67 + ], + [ + "2018-06-17", + 54 + ], + [ + "2018-06-18", + 101 + ], + [ + "2018-06-19", + 145 + ], + [ + "2018-06-20", + 84 + ], + [ + "2018-06-21", + 114 + ], + [ + "2018-06-22", + 82 + ], + [ + "2018-06-23", + 92 + ], + [ + "2018-06-24", + 36 + ], + [ + "2018-06-25", + 170 + ], + [ + "2018-06-26", + 132 + ], + [ + "2018-06-27", + 157 + ], + [ + "2018-06-28", + 171 + ], + [ + "2018-06-29", + 83 + ], + [ + "2018-06-30", + 42 + ], + [ + "2018-07-01", + 59 + ], + [ + "2018-07-02", + 224 + ], + [ + "2018-07-03", + 208 + ], + [ + "2018-07-04", + 68 + ], + [ + "2018-07-05", + 128 + ], + [ + "2018-07-06", + 62 + ], + [ + "2018-07-07", + 74 + ], + [ + "2018-07-08", + 19 + ], + [ + "2018-07-09", + 68 + ], + [ + "2018-07-10", + 152 + ], + [ + "2018-07-11", + 159 + ], + [ + "2018-07-12", + 45 + ], + [ + "2018-07-13", + 24 + ], + [ + "2018-07-14", + 30 + ], + [ + "2018-07-15", + 135 + ], + [ + "2018-07-16", + 132 + ], + [ + "2018-07-17", + 388 + ], + [ + "2018-07-18", + 293 + ], + [ + "2018-07-19", + 106 + ], + [ + "2018-07-20", + 70 + ], + [ + "2018-07-21", + 23 + ], + [ + "2018-07-22", + 23 + ], + [ + "2018-07-23", + 112 + ], + [ + "2018-07-24", + 151 + ], + [ + "2018-07-25", + 170 + ], + [ + "2018-07-26", + 108 + ], + [ + "2018-07-27", + 18 + ], + [ + "2018-07-28", + 118 + ], + [ + "2018-07-29", + 52 + ], + [ + "2018-07-30", + 90 + ], + [ + "2018-07-31", + 228 + ], + [ + "2018-08-01", + 98 + ], + [ + "2018-08-02", + 111 + ], + [ + "2018-08-03", + 81 + ], + [ + "2018-08-04", + 55 + ], + [ + "2018-08-05", + 94 + ], + [ + "2018-08-06", + 116 + ], + [ + "2018-08-07", + 96 + ], + [ + "2018-08-08", + 103 + ], + [ + "2018-08-09", + 81 + ], + [ + "2018-08-10", + 112 + ], + [ + "2018-08-11", + 20 + ], + [ + "2018-08-12", + 48 + ], + [ + "2018-08-13", + 120 + ], + [ + "2018-08-14", + 67 + ], + [ + "2018-08-15", + 108 + ], + [ + "2018-08-16", + 125 + ], + [ + "2018-08-17", + 45 + ], + [ + "2018-08-18", + 12 + ], + [ + "2018-08-19", + 66 + ], + [ + "2018-08-20", + 110 + ], + [ + "2018-08-21", + 286 + ], + [ + "2018-08-22", + 217 + ], + [ + "2018-08-23", + 169 + ], + [ + "2018-08-24", + 83 + ], + [ + "2018-08-25", + 31 + ], + [ + "2018-08-26", + 114 + ], + [ + "2018-08-27", + 150 + ], + [ + "2018-08-28", + 108 + ], + [ + "2018-08-29", + 79 + ], + [ + "2018-08-30", + 42 + ], + [ + "2018-08-31", + 150 + ], + [ + "2018-09-01", + 56 + ], + [ + "2018-09-02", + 59 + ], + [ + "2018-09-03", + 87 + ], + [ + "2018-09-04", + 132 + ], + [ + "2018-09-05", + 79 + ], + [ + "2018-09-06", + 139 + ], + [ + "2018-09-07", + 104 + ], + [ + "2018-09-08", + 21 + ], + [ + "2018-09-09", + 46 + ], + [ + "2018-09-10", + 18 + ], + [ + "2018-09-11", + 146 + ], + [ + "2018-09-12", + 109 + ], + [ + "2018-09-13", + 50 + ], + [ + "2018-09-14", + 65 + ], + [ + "2018-09-15", + 47 + ], + [ + "2018-09-16", + 56 + ], + [ + "2018-09-17", + 117 + ], + [ + "2018-09-18", + 353 + ], + [ + "2018-09-19", + 99 + ], + [ + "2018-09-20", + 142 + ], + [ + "2018-09-21", + 221 + ], + [ + "2018-09-22", + 110 + ], + [ + "2018-09-23", + 49 + ], + [ + "2018-09-24", + 58 + ], + [ + "2018-09-25", + 142 + ], + [ + "2018-09-26", + 142 + ], + [ + "2018-09-27", + 69 + ], + [ + "2018-09-28", + 28 + ], + [ + "2018-09-29", + 52 + ], + [ + "2018-09-30", + 55 + ], + [ + "2018-10-01", + 56 + ], + [ + "2018-10-02", + 14 + ], + [ + "2018-10-03", + 81 + ], + [ + "2018-10-04", + 40 + ], + [ + "2018-10-05", + 49 + ], + [ + "2018-10-06", + 154 + ], + [ + "2018-10-07", + 86 + ], + [ + "2018-10-08", + 131 + ], + [ + "2018-10-09", + 160 + ], + [ + "2018-10-10", + 96 + ], + [ + "2018-10-11", + 114 + ], + [ + "2018-10-12", + 115 + ], + [ + "2018-10-13", + 125 + ], + [ + "2018-10-14", + 170 + ], + [ + "2018-10-15", + 131 + ], + [ + "2018-10-16", + 118 + ], + [ + "2018-10-17", + 47 + ], + [ + "2018-10-18", + 153 + ], + [ + "2018-10-19", + 212 + ], + [ + "2018-10-20", + 191 + ], + [ + "2018-10-21", + 105 + ], + [ + "2018-10-22", + 157 + ], + [ + "2018-10-23", + 386 + ], + [ + "2018-10-24", + 179 + ], + [ + "2018-10-25", + 285 + ], + [ + "2018-10-26", + 151 + ], + [ + "2018-10-27", + 121 + ], + [ + "2018-10-28", + 104 + ], + [ + "2018-10-29", + 86 + ], + [ + "2018-10-30", + 225 + ], + [ + "2018-10-31", + 102 + ], + [ + "2018-11-01", + 106 + ], + [ + "2018-11-02", + 219 + ], + [ + "2018-11-03", + 122 + ], + [ + "2018-11-04", + 85 + ], + [ + "2018-11-05", + 578 + ], + [ + "2018-11-06", + 429 + ], + [ + "2018-11-07", + 282 + ], + [ + "2018-11-08", + 245 + ], + [ + "2018-11-09", + 197 + ], + [ + "2018-11-10", + 182 + ], + [ + "2018-11-11", + 80 + ], + [ + "2018-11-12", + 207 + ], + [ + "2018-11-13", + 187 + ], + [ + "2018-11-14", + 75 + ], + [ + "2018-11-15", + 135 + ], + [ + "2018-11-16", + 152 + ], + [ + "2018-11-17", + 76 + ], + [ + "2018-11-18", + 83 + ], + [ + "2018-11-19", + 107 + ], + [ + "2018-11-20", + 73 + ], + [ + "2018-11-21", + 87 + ], + [ + "2018-11-22", + 69 + ], + [ + "2018-11-23", + 60 + ], + [ + "2018-11-24", + 57 + ], + [ + "2018-11-25", + 83 + ], + [ + "2018-11-26", + 118 + ], + [ + "2018-11-27", + 230 + ], + [ + "2018-11-28", + 98 + ], + [ + "2018-11-29", + 43 + ], + [ + "2018-11-30", + 114 + ], + [ + "2018-12-01", + 51 + ], + [ + "2018-12-02", + 110 + ], + [ + "2018-12-03", + 65 + ], + [ + "2018-12-04", + 53 + ], + [ + "2018-12-05", + 44 + ], + [ + "2018-12-06", + 197 + ], + [ + "2018-12-07", + 95 + ], + [ + "2018-12-08", + 13 + ], + [ + "2018-12-09", + 17 + ], + [ + "2018-12-10", + 59 + ], + [ + "2018-12-11", + 165 + ], + [ + "2018-12-12", + 115 + ], + [ + "2018-12-13", + 150 + ], + [ + "2018-12-14", + 83 + ], + [ + "2018-12-15", + 12 + ], + [ + "2018-12-16", + 156 + ], + [ + "2018-12-17", + 37 + ], + [ + "2018-12-18", + 113 + ], + [ + "2018-12-19", + 36 + ], + [ + "2018-12-20", + 61 + ], + [ + "2018-12-21", + 46 + ], + [ + "2018-12-22", + 50 + ], + [ + "2018-12-23", + 138 + ], + [ + "2018-12-24", + 137 + ], + [ + "2018-12-25", + 124 + ], + [ + "2018-12-26", + 119 + ], + [ + "2018-12-27", + 73 + ], + [ + "2018-12-28", + 102 + ], + [ + "2018-12-29", + 88 + ], + [ + "2018-12-30", + 64 + ], + [ + "2018-12-31", + 101 + ], + [ + "2019-01-01", + 52 + ], + [ + "2019-01-02", + 112 + ], + [ + "2019-01-03", + 191 + ], + [ + "2019-01-04", + 110 + ], + [ + "2019-01-05", + 8 + ], + [ + "2019-01-06", + 15 + ], + [ + "2019-01-07", + 107 + ], + [ + "2019-01-08", + 274 + ], + [ + "2019-01-09", + 156 + ], + [ + "2019-01-10", + 62 + ], + [ + "2019-01-11", + 86 + ], + [ + "2019-01-12", + 92 + ], + [ + "2019-01-13", + 56 + ], + [ + "2019-01-14", + 174 + ], + [ + "2019-01-15", + 167 + ], + [ + "2019-01-16", + 48 + ], + [ + "2019-01-17", + 177 + ], + [ + "2019-01-18", + 43 + ], + [ + "2019-01-19", + 19 + ], + [ + "2019-01-20", + 60 + ], + [ + "2019-01-21", + 111 + ], + [ + "2019-01-22", + 35 + ], + [ + "2019-01-23", + 114 + ], + [ + "2019-01-24", + 143 + ], + [ + "2019-01-25", + 199 + ], + [ + "2019-01-26", + 113 + ], + [ + "2019-01-27", + 46 + ], + [ + "2019-01-28", + 276 + ], + [ + "2019-01-29", + 74 + ], + [ + "2019-01-30", + 45 + ], + [ + "2019-01-31", + 334 + ], + [ + "2019-02-01", + 193 + ], + [ + "2019-02-02", + 25 + ], + [ + "2019-02-03", + 62 + ], + [ + "2019-02-04", + 78 + ], + [ + "2019-02-05", + 63 + ], + [ + "2019-02-06", + 71 + ], + [ + "2019-02-07", + 61 + ], + [ + "2019-02-08", + 112 + ], + [ + "2019-02-09", + 103 + ], + [ + "2019-02-10", + 30 + ], + [ + "2019-02-11", + 88 + ], + [ + "2019-02-12", + 149 + ], + [ + "2019-02-13", + 57 + ], + [ + "2019-02-14", + 143 + ], + [ + "2019-02-15", + 271 + ], + [ + "2019-02-16", + 152 + ], + [ + "2019-02-17", + 53 + ], + [ + "2019-02-18", + 157 + ], + [ + "2019-02-19", + 263 + ], + [ + "2019-02-20", + 123 + ], + [ + "2019-02-21", + 324 + ] + ], + "highest_month": 8800, + "highest_day_average": 283, + "highest_week_average": 334, + "post": null +} diff --git a/WordPressKitTests/StatsRemoteV2Tests.swift b/WordPressKitTests/StatsRemoteV2Tests.swift index eaaff073..9c31f98a 100644 --- a/WordPressKitTests/StatsRemoteV2Tests.swift +++ b/WordPressKitTests/StatsRemoteV2Tests.swift @@ -17,6 +17,7 @@ class StatsRemoteV2Tests: RemoteTestCase, RESTTestable { let getReferrersMockFilename = "stats-referrer-data.json" let getPostsMockFilename = "stats-posts-data.json" let getPublishedPostsFilename = "stats-published-posts.json" + let getPostsDetailsFilename = "stats-post-details.json" // MARK: - Properties @@ -29,6 +30,7 @@ class StatsRemoteV2Tests: RemoteTestCase, RESTTestable { var siteReferrerDataEndpoint: String { return "sites/\(siteID)/stats/referrers/" } var sitePostsDataEndpoint: String { return "sites/\(siteID)/stats/top-posts/" } var sitePublishedPostsEndpoint: String { return "sites/\(siteID)/posts/" } + var sitePostDetailsEndpoint: String { return "sites/\(siteID)/post/9001" } var remote: StatsServiceRemoteV2! @@ -358,5 +360,79 @@ class StatsRemoteV2Tests: RemoteTestCase, RESTTestable { waitForExpectations(timeout: timeout, handler: nil) - } + } + + func testFetchPostDetail() { + let expect = expectation(description: "It should return post detail") + + stubRemoteResponse(sitePostDetailsEndpoint, filename: getPostsDetailsFilename, contentType: .ApplicationJSON) + + let feb21 = DateComponents(year: 2019, month: 2, day: 21) + let date = Calendar.autoupdatingCurrent.date(from: feb21)! + + remote.getDetails(forPostID: 9001) { (postDetails, error) in + XCTAssertNil(error) + XCTAssertNotNil(postDetails) + + XCTAssertEqual(postDetails?.fetchedDate, date) + XCTAssertEqual(postDetails?.totalViewsCount, 163343) + + XCTAssertEqual(postDetails?.dailyAveragesPerMonth.count, postDetails?.monthlyBreakdown.count) + XCTAssertEqual(postDetails?.dailyAveragesPerMonth.count, 10 + 12 + 12 + 12 + 2) + + let feb19Averages = postDetails?.dailyAveragesPerMonth.first { $0.date == DateComponents(year: 2019, month: 2) } + XCTAssertNotNil(feb19Averages) + XCTAssertEqual(feb19Averages?.period, .month) + XCTAssertEqual(feb19Averages?.viewsCount, 112) + + let feb19Views = postDetails?.monthlyBreakdown.first { $0.date == DateComponents(year: 2019, month: 2) } + XCTAssertNotNil(feb19Views) + XCTAssertEqual(feb19Views?.period, .month) + XCTAssertEqual(feb19Views?.viewsCount, 2578) + + XCTAssertEqual(postDetails?.lastTwoWeeks.count, 14) + + XCTAssertEqual(postDetails?.lastTwoWeeks.first?.viewsCount, 112) + XCTAssertEqual(postDetails?.lastTwoWeeks.first?.period, .day) + XCTAssertEqual(postDetails?.lastTwoWeeks.first?.date, DateComponents(year: 2019, month: 2, day: 08)) + + XCTAssertEqual(postDetails?.lastTwoWeeks.last?.viewsCount, 324) + XCTAssertEqual(postDetails?.lastTwoWeeks.last?.period, .day) + XCTAssertEqual(postDetails?.lastTwoWeeks.last?.date, DateComponents(year: 2019, month: 2, day: 21)) + + XCTAssertEqual(postDetails?.recentWeeks.count, 6) + + let leastRecentWeek = postDetails?.recentWeeks.first + let mostRecentWeek = postDetails?.recentWeeks.last + + XCTAssertNotNil(leastRecentWeek) + XCTAssertNotNil(mostRecentWeek) + + XCTAssertEqual(leastRecentWeek?.totalViewsCount, 688) + XCTAssertEqual(leastRecentWeek?.averageViewsCount, 98) + XCTAssertEqual(leastRecentWeek!.changePercentage, 0.0, accuracy: 0.0000000001) + XCTAssertEqual(leastRecentWeek?.startDay, DateComponents(year: 2019, month: 01, day: 14)) + XCTAssertEqual(leastRecentWeek?.endDay, DateComponents(year: 2019, month: 01, day: 20)) + XCTAssertEqual(leastRecentWeek?.days.count, 7) + XCTAssertEqual(leastRecentWeek?.days.first?.date, leastRecentWeek?.startDay) + XCTAssertEqual(leastRecentWeek?.days.last?.date, leastRecentWeek?.endDay) + XCTAssertEqual(leastRecentWeek?.days.first?.viewsCount, 174) + XCTAssertEqual(leastRecentWeek?.days.last?.viewsCount, 60) + + XCTAssertEqual(mostRecentWeek?.totalViewsCount, 867) + XCTAssertEqual(mostRecentWeek?.averageViewsCount, 181) + XCTAssertEqual(mostRecentWeek!.changePercentage, 38.7732, accuracy: 0.001) + XCTAssertEqual(mostRecentWeek?.startDay, DateComponents(year: 2019, month: 02, day: 18)) + XCTAssertEqual(mostRecentWeek?.endDay, DateComponents(year: 2019, month: 02, day: 21)) + XCTAssertEqual(mostRecentWeek?.days.count, 4) + XCTAssertEqual(mostRecentWeek?.days.first?.date, mostRecentWeek?.startDay) + XCTAssertEqual(mostRecentWeek?.days.last?.date, mostRecentWeek?.endDay) + XCTAssertEqual(mostRecentWeek?.days.first?.viewsCount, 157) + XCTAssertEqual(mostRecentWeek?.days.last?.viewsCount, 324) + + expect.fulfill() + } + + waitForExpectations(timeout: timeout, handler: nil) + } } From 0f98a2c3c5ed1a2087bba11892cd64d65ae44589 Mon Sep 17 00:00:00 2001 From: Jan Klausa Date: Fri, 22 Feb 2019 22:39:32 +0100 Subject: [PATCH 2/2] fix broken merge --- WordPressKit.xcodeproj/project.pbxproj | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/WordPressKit.xcodeproj/project.pbxproj b/WordPressKit.xcodeproj/project.pbxproj index 495de286..3ae86ecf 100644 --- a/WordPressKit.xcodeproj/project.pbxproj +++ b/WordPressKit.xcodeproj/project.pbxproj @@ -32,16 +32,17 @@ 404057DC221C9FD80060250C /* stats-referrer-data.json in Resources */ = {isa = PBXBuildFile; fileRef = 404057DB221C9FD70060250C /* stats-referrer-data.json */; }; 4041405E220F9EF500CF7C5B /* StatsDotComFollowersInsight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4041405D220F9EF500CF7C5B /* StatsDotComFollowersInsight.swift */; }; 40414060220F9F1F00CF7C5B /* StatsAllTimesInsight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4041405F220F9F1F00CF7C5B /* StatsAllTimesInsight.swift */; }; - 40819778221F00E600A298E4 /* SummaryStatsType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819777221F00E600A298E4 /* SummaryStatsType.swift */; }; - 4081977B221F153B00A298E4 /* stats-visits-week.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819779221F153A00A298E4 /* stats-visits-week.json */; }; - 4081977C221F153B00A298E4 /* stats-visits-day.json in Resources */ = {isa = PBXBuildFile; fileRef = 4081977A221F153A00A298E4 /* stats-visits-day.json */; }; - 4081977E221F269A00A298E4 /* stats-visits-month.json in Resources */ = {isa = PBXBuildFile; fileRef = 4081977D221F269A00A298E4 /* stats-visits-month.json */; }; 4081976F221DDE9B00A298E4 /* PostsStatsType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4081976E221DDE9B00A298E4 /* PostsStatsType.swift */; }; 40819771221DFDB700A298E4 /* stats-posts-data.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819770221DFDB600A298E4 /* stats-posts-data.json */; }; 40819773221E10C900A298E4 /* PublishedPostsStatsType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819772221E10C900A298E4 /* PublishedPostsStatsType.swift */; }; 40819775221E497D00A298E4 /* stats-published-posts.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819774221E497C00A298E4 /* stats-published-posts.json */; }; + 40819778221F00E600A298E4 /* SummaryStatsType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819777221F00E600A298E4 /* SummaryStatsType.swift */; }; + 4081977B221F153B00A298E4 /* stats-visits-week.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819779221F153A00A298E4 /* stats-visits-week.json */; }; + 4081977C221F153B00A298E4 /* stats-visits-day.json in Resources */ = {isa = PBXBuildFile; fileRef = 4081977A221F153A00A298E4 /* stats-visits-day.json */; }; + 4081977E221F269A00A298E4 /* stats-visits-month.json in Resources */ = {isa = PBXBuildFile; fileRef = 4081977D221F269A00A298E4 /* stats-visits-month.json */; }; 40819783221F5C8200A298E4 /* StatsPostDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40819782221F5C8200A298E4 /* StatsPostDetails.swift */; }; 40819785221F74B200A298E4 /* stats-post-details.json in Resources */ = {isa = PBXBuildFile; fileRef = 40819784221F74B200A298E4 /* stats-post-details.json */; }; + 408197882220A35000A298E4 /* StatsLastPostInsight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 408197872220A35000A298E4 /* StatsLastPostInsight.swift */; }; 40A71C6E220E1D8E002E3D25 /* StatsServiceRemoteV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40A71C6D220E1D8E002E3D25 /* StatsServiceRemoteV2.swift */; }; 40AB1ADA200FED25009B533D /* PluginDirectoryFeedPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40AB1AD9200FED25009B533D /* PluginDirectoryFeedPage.swift */; }; 40E4698B2017C2840030DB5F /* plugin-directory-popular.json in Resources */ = {isa = PBXBuildFile; fileRef = 40E4698A2017C2840030DB5F /* plugin-directory-popular.json */; }; @@ -475,7 +476,6 @@ E6C1E8491EF21FC100D139D9 /* is-passwordless-account-no-account-found.json in Resources */ = {isa = PBXBuildFile; fileRef = E6C1E8471EF21FC100D139D9 /* is-passwordless-account-no-account-found.json */; }; E6C1E84A1EF21FC100D139D9 /* is-passwordless-account-success.json in Resources */ = {isa = PBXBuildFile; fileRef = E6C1E8481EF21FC100D139D9 /* is-passwordless-account-success.json */; }; E6D0EE621F7EF9CE0064D3FC /* AccountServiceRemoteREST+SocialService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D0EE611F7EF9CE0064D3FC /* AccountServiceRemoteREST+SocialService.swift */; }; - F96E0643221E15A9008E7D97 /* StatsLastPostInsight.swift in Sources */ = {isa = PBXBuildFile; fileRef = F96E0642221E15A9008E7D97 /* StatsLastPostInsight.swift */; }; FF20AD2220B8471A00082398 /* WordPressKit.podspec in Resources */ = {isa = PBXBuildFile; fileRef = FF20AD2120B8471A00082398 /* WordPressKit.podspec */; }; FFE247A720C891D1002DF3A2 /* WordPressComOAuthTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFE247A620C891D1002DF3A2 /* WordPressComOAuthTests.swift */; }; FFE247AF20C891E6002DF3A2 /* WordPressComOAuthWrongPasswordFail.json in Resources */ = {isa = PBXBuildFile; fileRef = FFE247A820C891E5002DF3A2 /* WordPressComOAuthWrongPasswordFail.json */; }; @@ -527,16 +527,17 @@ 404057DB221C9FD70060250C /* stats-referrer-data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-referrer-data.json"; sourceTree = ""; }; 4041405D220F9EF500CF7C5B /* StatsDotComFollowersInsight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsDotComFollowersInsight.swift; sourceTree = ""; }; 4041405F220F9F1F00CF7C5B /* StatsAllTimesInsight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsAllTimesInsight.swift; sourceTree = ""; }; - 40819777221F00E600A298E4 /* SummaryStatsType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SummaryStatsType.swift; sourceTree = ""; }; - 40819779221F153A00A298E4 /* stats-visits-week.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-week.json"; sourceTree = ""; }; - 4081977A221F153A00A298E4 /* stats-visits-day.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-day.json"; sourceTree = ""; }; - 4081977D221F269A00A298E4 /* stats-visits-month.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-month.json"; sourceTree = ""; }; 4081976E221DDE9B00A298E4 /* PostsStatsType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsStatsType.swift; sourceTree = ""; }; 40819770221DFDB600A298E4 /* stats-posts-data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-posts-data.json"; sourceTree = ""; }; 40819772221E10C900A298E4 /* PublishedPostsStatsType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishedPostsStatsType.swift; sourceTree = ""; }; 40819774221E497C00A298E4 /* stats-published-posts.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-published-posts.json"; sourceTree = ""; }; + 40819777221F00E600A298E4 /* SummaryStatsType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SummaryStatsType.swift; sourceTree = ""; }; + 40819779221F153A00A298E4 /* stats-visits-week.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-week.json"; sourceTree = ""; }; + 4081977A221F153A00A298E4 /* stats-visits-day.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-day.json"; sourceTree = ""; }; + 4081977D221F269A00A298E4 /* stats-visits-month.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-visits-month.json"; sourceTree = ""; }; 40819782221F5C8200A298E4 /* StatsPostDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsPostDetails.swift; sourceTree = ""; }; 40819784221F74B200A298E4 /* stats-post-details.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "stats-post-details.json"; sourceTree = ""; }; + 408197872220A35000A298E4 /* StatsLastPostInsight.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsLastPostInsight.swift; sourceTree = ""; }; 40A71C6D220E1D8E002E3D25 /* StatsServiceRemoteV2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsServiceRemoteV2.swift; sourceTree = ""; }; 40AB1AD9200FED25009B533D /* PluginDirectoryFeedPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginDirectoryFeedPage.swift; sourceTree = ""; }; 40E4698A2017C2840030DB5F /* plugin-directory-popular.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "plugin-directory-popular.json"; sourceTree = ""; }; @@ -984,7 +985,6 @@ E6D0EE611F7EF9CE0064D3FC /* AccountServiceRemoteREST+SocialService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountServiceRemoteREST+SocialService.swift"; sourceTree = ""; }; ED05C8FF3E61D93CE5BA527E /* Pods_WordPressKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EFF80A6E6EE37118CB1DA158 /* Pods_WordPressKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F96E0642221E15A9008E7D97 /* StatsLastPostInsight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsLastPostInsight.swift; sourceTree = ""; }; FF20AD2120B8471A00082398 /* WordPressKit.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WordPressKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; FFE247A620C891D1002DF3A2 /* WordPressComOAuthTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressComOAuthTests.swift; sourceTree = ""; }; FFE247A820C891E5002DF3A2 /* WordPressComOAuthWrongPasswordFail.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = WordPressComOAuthWrongPasswordFail.json; sourceTree = ""; }; @@ -1052,7 +1052,7 @@ 40414061220F9F2800CF7C5B /* Insights */ = { isa = PBXGroup; children = ( - F96E0642221E15A9008E7D97 /* StatsLastPostInsight.swift */, + 408197872220A35000A298E4 /* StatsLastPostInsight.swift */, 4041405D220F9EF500CF7C5B /* StatsDotComFollowersInsight.swift */, 40E7FEA8220FA4050032834E /* StatsEmailFollowersInsight.swift */, 4041405F220F9F1F00CF7C5B /* StatsAllTimesInsight.swift */, @@ -1071,7 +1071,6 @@ children = ( 404057C3221B30140060250C /* Time-based data */, 40414061220F9F2800CF7C5B /* Insights */, - F96E0642221E15A9008E7D97 /* StatsLastPostInsight.swift */, 40819782221F5C8200A298E4 /* StatsPostDetails.swift */, ); name = V2; @@ -2294,6 +2293,7 @@ 7430C9B41F1927C50051B8E6 /* RemoteReaderSite.m in Sources */, 74585B8E1F0D51A100E7E667 /* DomainsServiceRemote.swift in Sources */, 7430C9A41F1927180051B8E6 /* ReaderPostServiceRemote.m in Sources */, + 408197882220A35000A298E4 /* StatsLastPostInsight.swift in Sources */, 74E2294E1F1E73FE0085F7F2 /* RemotePublicizeService.swift in Sources */, 9F3E0BA22087345F009CB5BA /* ServiceRequest.swift in Sources */, E1A6605F1FD694ED00BAC339 /* PluginDirectoryEntry.swift in Sources */, @@ -2352,7 +2352,6 @@ 93F50A381F226B9300B5BEBA /* WordPressComServiceRemote.m in Sources */, 9F4E52002088E38200424676 /* ObjectValidation.swift in Sources */, 7430C9B81F1927C50051B8E6 /* RemoteReaderTopic.m in Sources */, - F96E0643221E15A9008E7D97 /* StatsLastPostInsight.swift in Sources */, 7403A3021EF0726E00DED7DC /* AccountSettings.swift in Sources */, 40E7FEA9220FA4060032834E /* StatsEmailFollowersInsight.swift in Sources */, 404057DA221C9D560060250C /* ReferrerStatsType.swift in Sources */,