-Added Songtexte.com Lyrics Hoster
-Repositioned the load more results button into the outline view -Improved the replacing of html escape characters -Lyrics Hosters can now be dragged into a preferred order in the preference window -Changed results outline's column ordering method -Some code changes -Replaced the Buttons in the lyrics pane with an action button -Preferred order of lyrics hosters will now be saved -Translation Improvements
This commit is contained in:
23
iLyrics/LyricsHosterUtil.m
Normal file
23
iLyrics/LyricsHosterUtil.m
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// LyricsHosterUtil.m
|
||||
// iLyrics
|
||||
//
|
||||
// Created by Kim Wittenburg on 22.06.12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LyricsHosterUtil.h"
|
||||
|
||||
@implementation NSString(LyricsHosterUtil)
|
||||
|
||||
-(NSString*) stringByRemovingHTMLTags {
|
||||
return [[[[[[[[[[[[[[[self
|
||||
stringByReplacingOccurrencesOfString:@"\n" withString:@""] stringByReplacingOccurrencesOfString:@"<strong>" withString:@""] stringByReplacingOccurrencesOfString:@"</strong>" withString:@""] stringByReplacingOccurrencesOfString:@"<b>" withString:@""] stringByReplacingOccurrencesOfString:@"</b>" withString:@""] stringByReplacingOccurrencesOfString:@"<i>" withString:@""] stringByReplacingOccurrencesOfString:@"</i>" withString:@""] stringByReplacingOccurrencesOfString:@"<p>" withString:@""] stringByReplacingOccurrencesOfString:@"</p>" withString:@"\n\n"] stringByReplacingOccurrencesOfString:@"<br />" withString:@"\n"] stringByReplacingOccurrencesOfString:@"<br/>" withString:@"\n"] stringByReplacingOccurrencesOfString:@""" withString:@"\""] stringByReplacingOccurrencesOfString:@"&" withString:@"&"] stringByReplacingOccurrencesOfString:@"'" withString:@"'"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
-(NSString *) stringByFormattingForURL {
|
||||
//Can replace äöü with aou, no difference in results
|
||||
NSCharacterSet *characters = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
|
||||
return [[[self stringByReplacingOccurrencesOfString:@" " withString:@"+"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByTrimmingCharactersInSet:characters];
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user