| | |
| | | |
| | | - (void)getHotSearch { |
| | | if (![YTHsharedManger startManger].searchTitle || [[YTHsharedManger startManger].searchTitle isEqualToString:@""]) { |
| | | [[YTHNetInterface startInterface] getHotSerachWithUid:[YTHsharedManger startManger].Uid withSystem:@"1" withblock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | [[YTHNetInterface startInterface] fetchHotSerchListWithUid:^(BOOL isSuccessful, id result, NSString *error) { |
| | | if (isSuccessful) { |
| | | NSDictionary *dic = (NSDictionary *)result; |
| | | if (!_dataHot) { |
| | | self.dataHot = [[NSMutableArray alloc] initWithCapacity:0]; |
| | | } |
| | | [self.dataHot removeAllObjects]; |
| | | NSArray *ar = [[dic objectForKey:@"Data"] objectForKey:@"data"]; |
| | | NSArray *ar = [[dic objectForKey:@"Data"] objectForKey:@"data"][@"热搜榜"]; |
| | | for (int i =0; i<ar.count; i++) { |
| | | [self.dataHot addObject:[ar objectAtIndex:i]]; |
| | | } |
| | | NSInteger rand = arc4random()%self.dataHot.count ; |
| | | self.viewRecommendNav.title = self.dataHot[rand]; |
| | | [YTHsharedManger startManger].searchTitle = self.viewRecommendNav.title; |
| | | |
| | | } else { |
| | | |
| | | } |
| | | }]; |
| | | |