Latest Episode
 

Go Back   Keith and The Girl Forums Keith and The Girl Forums Talk Shite

Talk Shite General discussion

Reply
 
Thread Tools Display Modes
Old 05-28-2009, 06:20 PM   #401 (permalink)
Senior Member
 
Join Date: Apr 2009
Location: Knoxville Tn
Posts: 108
Quote:
Originally Posted by hayroob View Post
I'm pretty sure that you could just sign it with ldid, but I'm not sure what the latest rules are.

EDIT:
Try this (skip step 1)
Transfer your apps to your jailbroken iPhone | Malaysian Tech Blogger
Hey that worked!

The app seems to work great. I've explored everything and sampled a few episodes and haven't seen any bugs so far.
(Offline)   Reply With Quote
Old 05-28-2009, 07:15 PM   #402 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by fubaya View Post
Hey that worked!

The app seems to work great. I've explored everything and sampled a few episodes and haven't seen any bugs so far.
Excellent, good to hear
(Offline)   Reply With Quote
Old 05-28-2009, 11:20 PM   #403 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by Willeth View Post
I'm still getting the same error with the configuration tool.
So I googled your error and I got nothing and really I'm not sure what the jamup is, are your itunes and OS all up to date?
(Offline)   Reply With Quote
Old 05-29-2009, 06:43 AM   #404 (permalink)
Senior Member
 
Willeth's Avatar
 
Join Date: Aug 2007
Location: England
Posts: 139
Quote:
Originally Posted by hayroob View Post
So I googled your error and I got nothing and really I'm not sure what the jamup is, are your itunes and OS all up to date?
Yeah. I double-checked the UDID that I sent you and that all checks out as well.

Could it possibly be a region issue? Surely I'm not the only person outside NA to try it. If it's too much bother to fix then I'll just grab it when it's actually released.
(Offline)   Reply With Quote
Old 05-29-2009, 08:48 AM   #405 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by Willeth View Post
Yeah. I double-checked the UDID that I sent you and that all checks out as well.

Could it possibly be a region issue? Surely I'm not the only person outside NA to try it. If it's too much bother to fix then I'll just grab it when it's actually released.
I'm pretty sure there are some other foreigner types testing. I'll keep looking into it but I'm really not sure what's happening.
(Offline)   Reply With Quote
Old 06-02-2009, 02:30 AM   #406 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Finished my rewrite of the URL detection in the twitter page, it's a bit stricter about well formed urls than the old code, but less cruft slips through. I'm using regexkitlite to do all the pattern matching.

Scope my logic and see if it there's anything worth improving.

Code:
//
//  extractURL.m
//  KATG.com
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

#import "extractURL.h"
#import "RegexKitLite.h"


@implementation extractURL

//*******************************************************
//* init
//* 
//* Set up object
//*******************************************************
- (id)init {
	return self;
}

//*******************************************************
//* makeURLList:(NSString *)stringWithURLs
//* 
//* Create an array of URL strings
//*******************************************************
- (id)makeURLList:(NSString *)stringWithURLs {
	NSMutableArray *urlList = [[NSMutableArray alloc] initWithCapacity:12];
	NSMutableDictionary *urlDict = [NSMutableDictionary dictionary];
	
	urlDict = [self makeURL:stringWithURLs];
	if (urlDict != nil) {
		NSString *protocolString = [urlDict objectForKey:@"protocol"];
		NSString *hostString = [urlDict objectForKey:@"host"];
		NSString *pathString = [urlDict objectForKey:@"path"];
		NSString *url = [protocolString stringByAppendingString:hostString]; 
		if (pathString != nil) {
			url = [url stringByAppendingString:pathString];
		}
		
		[urlList addObject:url];
	}
	
	int offset = 0;
	while (urlDict != nil) {
		offset += [[urlDict objectForKey:@"location"] intValue] + [[urlDict objectForKey:@"length"] intValue] - 1;
		int length = stringWithURLs.length - offset;
		urlDict = [self makeURL:[stringWithURLs substringWithRange:NSMakeRange( offset, length ) ]];		
		if (urlDict != nil) {
			NSString *protocolString = [urlDict objectForKey:@"protocol"];
			NSString *hostString = [urlDict objectForKey:@"host"];
			NSString *pathString = [urlDict objectForKey:@"path"];
			NSString *url = [protocolString stringByAppendingString:hostString]; 
			if (pathString != nil) {
				url = [url stringByAppendingString:pathString];
			}
			
			[urlList addObject:url];
		}
	}
	
	return urlList;
}

//*******************************************************
//* makeURL:(NSString *)searchString
//* 
//* Create an array of tweet user dictionaries
//*******************************************************
- (id)makeURL:(NSString *)searchString {
	NSString *regexString = @"\\b(https?://)(?:(\\S+?)(?::(\\S+?))?@)?([a-zA-Z0-9\\-.]+)(?::(\\d+))?((?:/[a-zA-Z0-9\\-._?,'+\\&%$=~*!():@\\\\]*)+)?";
	NSMutableDictionary *urlDictionary = [NSMutableDictionary dictionary];
	NSRange matchedRange = NSMakeRange(NSNotFound, 0UL); 
	
	if ([searchString isMatchedByRegex:regexString]) {
		matchedRange = [searchString rangeOfRegex:regexString];
		int Location = matchedRange.location;
		int Length = matchedRange.length;
		NSNumber *location = [[NSNumber alloc] initWithInt:Location];
		NSNumber *length = [[NSNumber alloc] initWithInt:Length];
		NSString *protocolString = [searchString stringByMatching:regexString capture:1L];
		NSString *hostString = [searchString stringByMatching:regexString capture:4L];
		NSString *pathString = [searchString stringByMatching:regexString capture:6L];
		
		regexString = @"\\.$|\\?$|\\!$";
		matchedRange = NSMakeRange(NSNotFound, 0UL);
		matchedRange = [pathString rangeOfRegex:regexString];
		if (matchedRange.location != NSNotFound) {
			pathString = [pathString substringWithRange:NSMakeRange(0, pathString.length - 1)];
		}
		
		if (location)       {[urlDictionary setObject:location forKey:@"location"];}
		if (length)         {[urlDictionary setObject:length forKey:@"length"];}
		if (protocolString) {[urlDictionary setObject:protocolString forKey:@"protocol"];} 
		if (hostString)     {[urlDictionary setObject:hostString forKey:@"host"];}
		if (pathString)     {[urlDictionary setObject:pathString forKey:@"path"];}
		NSLog(@"urlDictionary: %@", urlDictionary);
		
		return urlDictionary;
	} else {
		return nil;
	}
}

//*******************************************************
//* makeTWTList:(NSString *)stringWithTWTs
//* 
//* Extract, using regular expressions,
//* the first URL that occurs in a string
//* Results are compiled in an array
//*******************************************************

- (id)makeTWTList:(NSString *)stringWithTWTs {
	NSMutableArray *twtList = [[NSMutableArray alloc] initWithCapacity:12];
	NSMutableDictionary *twtDict = [NSMutableDictionary dictionary];
	
	twtDict = [self makeTwitterSearchURL:stringWithTWTs];
	if (twtDict != nil) {
		NSMutableDictionary *url = [NSMutableDictionary dictionary];
		
		[url setObject:[twtDict objectForKey:@"user"] forKey:@"user"];
		[url setObject:[twtDict objectForKey:@"url"] forKey:@"url"];
		
		[twtList addObject:url];
	}
	
	int offset = 0;
	while (twtDict != nil) {
		offset += [[twtDict objectForKey:@"location"] intValue] + [[twtDict objectForKey:@"length"] intValue] - 1;
		int length = stringWithTWTs.length - offset;
		twtDict = [self makeTwitterSearchURL:[stringWithTWTs substringWithRange:NSMakeRange( offset, length ) ]];		
		if (twtDict != nil) {
			NSMutableDictionary *url = [NSMutableDictionary dictionary];
			
			[url setObject:[twtDict objectForKey:@"user"] forKey:@"user"];
			[url setObject:[twtDict objectForKey:@"url"] forKey:@"url"];
			
			[twtList addObject:url];
		}
	}
	
	return twtList;
}

//*******************************************************
//* makeTwitterSearchURL:(NSString *)searchString
//* 
//* Extract, using regular expressions,
//* the first twitter user name that
//* occurs in a string
//* Results are compiled in a dictionary as
//* the the user name and the json library
//* URL
//*******************************************************
- (id)makeTwitterSearchURL:(NSString *)searchString {
	NSString *regexString = @"@([0-9a-zA-Z_]+)";
	NSMutableDictionary *urlDictionary = [NSMutableDictionary dictionary];
	NSRange matchedRange = NSMakeRange(NSNotFound, 0UL); 
	
	if ([searchString isMatchedByRegex:regexString]) {
		matchedRange = [searchString rangeOfRegex:regexString];
		int Location = matchedRange.location;
		int Length = matchedRange.length;
		NSNumber *location = [[NSNumber alloc] initWithInt:Location];
		NSNumber *length = [[NSNumber alloc] initWithInt:Length];
		NSString *twtUser = [searchString stringByMatching:regexString capture:1L];
		NSString *twtUserSearchUrl = @"http://search.twitter.com/search.json?q=from%3A";
		twtUserSearchUrl = [[twtUserSearchUrl stringByAppendingString:twtUser] stringByAppendingString:@"&rpp=10"];
		
		if (location)         {[urlDictionary setObject:location forKey:@"location"];}
		if (length)           {[urlDictionary setObject:length forKey:@"length"];}
		if (twtUser)          {[urlDictionary setObject:twtUser forKey:@"user"];} 
		if (twtUserSearchUrl) {[urlDictionary setObject:twtUserSearchUrl forKey:@"url"];} 

		NSLog(@"urlDictionary: %@", urlDictionary);
		
		return urlDictionary;
	} else {
		return nil;
	}
}

- (void)dealloc {
    [super dealloc];
}

@end
The first thing I'm going to work on next, is adding flags to the methods to include/exclude location/length data for the data and then I can use that to figure where to draw buttons to make links/users clickable instead of using an intermediary view.

Last edited by hayroob; 06-02-2009 at 02:47 AM.
(Offline)   Reply With Quote
Old 06-02-2009, 03:54 AM   #407 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Latest Greatest:
http://katgapp.com/06-02-09-KATG.com.zip
(Offline)   Reply With Quote
Old 06-02-2009, 07:11 AM   #408 (permalink)
Senior Member
 
hypercrypt's Avatar
 
Join Date: Nov 2006
Location: My Place: Liverpool. Born and raised in Berlin.
Posts: 771
Finally got around to installing a working version of the App. I have written some code that will fill in the Location field of the feedback section with a single button click using Cole Location and MapKit. Would you like me to send this to you?

I'd be happy to release it under a dual licence, i.e. release it under GPL (don't care the version, you choose) but retain all rights to use my version of the code under other licenses.
(Offline)   Reply With Quote
Old 06-02-2009, 12:44 PM   #409 (permalink)
Administrator
 
hayroob's Avatar
 
Join Date: Mar 2008
Location: Detroitish
Posts: 1,654
Quote:
Originally Posted by hypercrypt View Post
Finally got around to installing a working version of the App. I have written some code that will fill in the Location field of the feedback section with a single button click using Cole Location and MapKit. Would you like me to send this to you?

I'd be happy to release it under a dual licence, i.e. release it under GPL (don't care the version, you choose) but retain all rights to use my version of the code under other licenses.
Does it use a lot of mem/CPU because a lot people just fill in location with jokes.

And the license your looking for is BSD, you can offer the code for free and open use but you don't have to open anything you develop based on that code.
(Offline)   Reply With Quote
Old 06-02-2009, 12:59 PM   #410 (permalink)
Senior Member
 
hypercrypt's Avatar
 
Join Date: Nov 2006
Location: My Place: Liverpool. Born and raised in Berlin.
Posts: 771
No, it doesn't.

I understand that people use it as a joke. The way I have set it up is that there is a small button that can be pressed to populate the location field. I am just extracting the code from the UIViewController into it's own class. From there it is very easy to implement, literally half a dozen lines of code. I'll send you the files once I am done, i.e. later today.

Last edited by hypercrypt; 06-02-2009 at 01:31 PM.
(Offline)   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT -5. The time now is 12:40 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Keith and The Girl