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 )); }
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); }
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; }