En essayant d'analyser les tendances de twitter, je continue d'obtenir une erreur d'analyseur à "as_of". quelquun sait pourquoi cela se passe?Essayer d'analyser les tendances de twitter
EDIT:
Voici le code im en utilisant
NSMutableArray *tweets;
tweets = [[NSMutableArray alloc] init];
NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/trends/current.json"];
trendsArray = [[NSMutableArray alloc] initWithArray:[CCJSONParser objectFromJSON:[NSString stringWithContentsOfURL:url encoding:4 error:nil]]];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
for (int i = 0; i < [trendsArray count]; i++) {
dict = [[NSMutableDictionary alloc] init];
//[post setObject: [[currentArray objectAtIndex:i] objectForKey:@"query"]];
[dict setObject:[trendsArray objectAtIndex:i] forKey:@"trends"];
//[dict setObject:[trendsArray objectAtIndex:i] forKey:@"query"];
//[post setObject:[trendsArray objectAtIndex:i] forKey:@"as_of"];
[tweets addObject:dict];
//post = nil;
}
Pouvez-vous poster un échantillon de code et de données? –
Utilisez-vous simplement http://search.twitter.com/trends/current.json? Quelle bibliothèque/framework d'analyse JSON utilisez-vous? Publiez le code que vous utilisez. –
J'utilise CCJSON pour analyser les tendances Publié le code ci-dessus – timothy5216