Changeset 624
- Timestamp:
- 07/05/08 16:36:46 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m
r617 r624 39 39 /* IMDB XPATHS */ 40 40 #define IMDB_SEARCH_XPATH @"//td[starts-with(a/@href,'/title')]" 41 #define IMDB_UNIQUE_SEARCH_XPATH @"//a [@class='tn15more']/@href"41 #define IMDB_UNIQUE_SEARCH_XPATH @"//a/@href[starts-with(.,'http://pro.imdb.com/title')]" 42 42 #define IMDB_RESULT_LINK_XPATH @"a/@href" 43 43 #define IMDB_POSTER_LINK_XPATH @"//ul/li/a/@href" … … 563 563 if(resultURL == nil) 564 564 continue; 565 NSString *URLSubPath =[resultURL path] ; 566 unsigned int location = [URLSubPath rangeOfString:@"#"].location; 565 NSString *URLSubPath =[resultURL path]; 566 unsigned int location = [URLSubPath rangeOfString:@"/title/"].location; 567 int count = 0; 567 568 if(location != NSNotFound) 568 URLSubPath = [URLSubPath substringToIndex:location]; 569 if([URLSubPath hasSuffix:@"/releaseinfo"]) 570 { 571 URLSubPath=[URLSubPath stringByReplacingAllOccurancesOf:@"/releaseinfo" withString:@""]; 569 { 570 NSString *subStr = [URLSubPath substringFromIndex:location]; 571 count = [[subStr pathComponents] count]; 572 } 573 if(count == 3) 574 { 575 URLSubPath=[URLSubPath stringByReplacingAllOccurancesOf:@"//pro." withString:@"//www."]; 572 576 [ret addObject:[NSDictionary dictionaryWithObjectsAndKeys: 573 resultTitle, MOVIE_TRAN_IMDB_NAME_KEY,574 URLSubPath, MOVIE_TRAN_IMDB_LINK_KEY,575 nil]];576 return ret ; 577 resultTitle, MOVIE_TRAN_IMDB_NAME_KEY, 578 URLSubPath, MOVIE_TRAN_IMDB_LINK_KEY, 579 nil]]; 580 return ret ; 577 581 } 578 582 }
