Example #1
0
        private static DiscoveryResultsData GetDiscoverySectionData(DiscoverySearchSection section, int limit)
        {
            var query = new DiscoveryResultsQuery(section, limit);

            return(JSON.Deserialize <DiscoveryResultsData>(
                       CLIENT_MAIN.Execute(
                           new RestRequest(
                               "1/apitun/discovery/section",
                               Method.POST
                               ).AddJsonBody(query)
                           ).Content
                       ));
        }
Example #2
0
        public static DiscoveryResult[] GetDiscoverySection(DiscoverySearchSection section, int limit)
        {
            var results = GetDiscoverySectionData(section, limit).results.rows.data;

            if (section == DiscoverySearchSection.instagram)
            {
                int count = results.Length;
                for (int i = 0; i < count; ++i)
                {
                    results[i].instagram.RemoveAll(p => p.height == 0);
                }
            }
            return(results);
        }
Example #3
0
        public static (Question[], DiscoveryResult[]) GetImportantQuestionsDiscovery(DiscoverySearchSection section, int limit)
        {
            var data = GetDiscoverySectionData(section, limit);

            return(data.header_component.metadata.questions, data.results.rows.data);
        }
 public DiscoveryResultsQuery(DiscoverySearchSection section, int limit)
 {
     this.section = section;
     this.limit   = limit;
 }