// // Mp3Lyrics.m // iLyrics // // Created by Kim Wittenburg on 24.06.12. // Copyright (c) 2012 __MyCompanyName__. All rights reserved. // #import "MP3Lyrics.h" @implementation MP3Lyrics { NSString *query; NSString *firstPage; int resultCount; int loadedResults; } @synthesize enabled; -(NSString *)name { return @"MP3 Lyrics"; } -(NSDate *)hosterVersion { return [NSDate dateWithString:@"2012-06-24 15:00:00 +0100"]; } -(void)startNewSearchForQuery:(NSString *)q { query = [q stringByFormattingForURL]; int site = loadedResults; NSString *searchPath = [NSString stringWithFormat:@"http://www.mp3lyrics.org/Search/%@%%7C%i", query, site]; NSURL *searchURL = [NSURL URLWithString:searchPath]; NSError *error; firstPage = [NSString stringWithContentsOfURL:searchURL encoding:NSUTF8StringEncoding error:&error]; if (error || firstPage == nil) { firstPage = nil; return; } if ([firstPage rangeOfString:@"