Permalink
Browse files

flesh out, add basic Instapaper support

  • Loading branch information...
1 parent 15c1744 commit ab538612df382c3f78b27536fed8aeed25f6a186 @samsonjs committed Dec 19, 2011
@@ -27,6 +27,11 @@
7B1A6EF1149D140600FC5105 /* SSDetailViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B1A6EEF149D140600FC5105 /* SSDetailViewController_iPad.xib */; };
7B1A6EF9149D148800FC5105 /* FiveByFive.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B1A6EF8149D148800FC5105 /* FiveByFive.m */; };
7B1A6EFC149D14C500FC5105 /* Show.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B1A6EFB149D14C500FC5105 /* Show.m */; };
+ 7B4CADE9149FE797007E7941 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B4CADE8149FE797007E7941 /* Security.framework */; };
+ 7B4CADF0149FE944007E7941 /* UIAlertView+marshmallows.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B4CADEE149FE944007E7941 /* UIAlertView+marshmallows.h */; };
+ 7B4CADF1149FE944007E7941 /* UIAlertView+marshmallows.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B4CADEF149FE944007E7941 /* UIAlertView+marshmallows.m */; };
+ 7B4CADF5149FEAE5007E7941 /* UIAlertViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B4CADF3149FEAE5007E7941 /* UIAlertViewDelegate.h */; };
+ 7B4CADF6149FEAE5007E7941 /* UIAlertViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B4CADF4149FEAE5007E7941 /* UIAlertViewDelegate.m */; };
7B7302F2149D670A003547E5 /* GTMNSString+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B7302EA149D670A003547E5 /* GTMNSString+HTML.h */; };
7B7302F3149D670A003547E5 /* GTMNSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B7302EB149D670A003547E5 /* GTMNSString+HTML.m */; };
7B7302F4149D670A003547E5 /* NSDate+InternetDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B7302EC149D670A003547E5 /* NSDate+InternetDateTime.h */; };
@@ -46,6 +51,12 @@
7B86894B149D5C1000F3A2C6 /* ShowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B868949149D5C0F00F3A2C6 /* ShowViewController.m */; };
7B868951149D5C6F00F3A2C6 /* ShowViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B86894D149D5C6F00F3A2C6 /* ShowViewController_iPad.xib */; };
7B868952149D5C6F00F3A2C6 /* ShowViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B86894F149D5C6F00F3A2C6 /* ShowViewController_iPhone.xib */; };
+ 7BDCFA03149E695E00DDF1B3 /* MMHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDCFA01149E695E00DDF1B3 /* MMHTTPRequest.h */; };
+ 7BDCFA04149E695E00DDF1B3 /* MMHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFA02149E695E00DDF1B3 /* MMHTTPRequest.m */; };
+ 7BDCFA07149E69E700DDF1B3 /* MMHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDCFA05149E69E700DDF1B3 /* MMHTTPClient.h */; };
+ 7BDCFA08149E69E700DDF1B3 /* MMHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFA06149E69E700DDF1B3 /* MMHTTPClient.m */; };
+ 7BDCFA0B149E6A2B00DDF1B3 /* NSString+marshmallows.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDCFA09149E6A2A00DDF1B3 /* NSString+marshmallows.h */; };
+ 7BDCFA0C149E6A2B00DDF1B3 /* NSString+marshmallows.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFA0A149E6A2B00DDF1B3 /* NSString+marshmallows.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -77,6 +88,11 @@
7B1A6EF8149D148800FC5105 /* FiveByFive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FiveByFive.m; sourceTree = "<group>"; };
7B1A6EFA149D14C500FC5105 /* Show.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Show.h; sourceTree = "<group>"; };
7B1A6EFB149D14C500FC5105 /* Show.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Show.m; sourceTree = "<group>"; };
+ 7B4CADE8149FE797007E7941 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
+ 7B4CADEE149FE944007E7941 /* UIAlertView+marshmallows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+marshmallows.h"; sourceTree = "<group>"; };
+ 7B4CADEF149FE944007E7941 /* UIAlertView+marshmallows.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+marshmallows.m"; sourceTree = "<group>"; };
+ 7B4CADF3149FEAE5007E7941 /* UIAlertViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAlertViewDelegate.h; sourceTree = "<group>"; };
+ 7B4CADF4149FEAE5007E7941 /* UIAlertViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIAlertViewDelegate.m; sourceTree = "<group>"; };
7B7302EA149D670A003547E5 /* GTMNSString+HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSString+HTML.h"; sourceTree = "<group>"; };
7B7302EB149D670A003547E5 /* GTMNSString+HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSString+HTML.m"; sourceTree = "<group>"; };
7B7302EC149D670A003547E5 /* NSDate+InternetDateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+InternetDateTime.h"; sourceTree = "<group>"; };
@@ -98,13 +114,21 @@
7B868949149D5C0F00F3A2C6 /* ShowViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowViewController.m; sourceTree = "<group>"; };
7B86894E149D5C6F00F3A2C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ShowViewController_iPad.xib; sourceTree = "<group>"; };
7B868950149D5C6F00F3A2C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ShowViewController_iPhone.xib; sourceTree = "<group>"; };
+ 7BDCFA00149E688600DDF1B3 /* InstapaperCredentials.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InstapaperCredentials.h; sourceTree = "<group>"; };
+ 7BDCFA01149E695E00DDF1B3 /* MMHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHTTPRequest.h; sourceTree = "<group>"; };
+ 7BDCFA02149E695E00DDF1B3 /* MMHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHTTPRequest.m; sourceTree = "<group>"; };
+ 7BDCFA05149E69E700DDF1B3 /* MMHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHTTPClient.h; sourceTree = "<group>"; };
+ 7BDCFA06149E69E700DDF1B3 /* MMHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHTTPClient.m; sourceTree = "<group>"; };
+ 7BDCFA09149E6A2A00DDF1B3 /* NSString+marshmallows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+marshmallows.h"; sourceTree = "<group>"; };
+ 7BDCFA0A149E6A2B00DDF1B3 /* NSString+marshmallows.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+marshmallows.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7B1A6EC7149D140600FC5105 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 7B4CADE9149FE797007E7941 /* Security.framework in Frameworks */,
7B1A6ECF149D140600FC5105 /* UIKit.framework in Frameworks */,
7B1A6ED1149D140600FC5105 /* Foundation.framework in Frameworks */,
7B1A6ED3149D140600FC5105 /* CoreGraphics.framework in Frameworks */,
@@ -118,6 +142,7 @@
isa = PBXGroup;
children = (
7B7302E9149D66ED003547E5 /* MWFeedParser */,
+ 7B4CADF2149FE954007E7941 /* Marshmallows */,
7B1A6ED4149D140600FC5105 /* 5by5Browser */,
7B1A6ECD149D140600FC5105 /* Frameworks */,
7B1A6ECB149D140600FC5105 /* Products */,
@@ -135,6 +160,7 @@
7B1A6ECD149D140600FC5105 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 7B4CADE8149FE797007E7941 /* Security.framework */,
7B1A6ECE149D140600FC5105 /* UIKit.framework */,
7B1A6ED0149D140600FC5105 /* Foundation.framework */,
7B1A6ED2149D140600FC5105 /* CoreGraphics.framework */,
@@ -145,6 +171,7 @@
7B1A6ED4149D140600FC5105 /* 5by5Browser */ = {
isa = PBXGroup;
children = (
+ 7BDCFA00149E688600DDF1B3 /* InstapaperCredentials.h */,
7B1A6EDD149D140600FC5105 /* SSAppDelegate.h */,
7B1A6EDE149D140600FC5105 /* SSAppDelegate.m */,
7B868948149D5C0F00F3A2C6 /* ShowViewController.h */,
@@ -187,6 +214,24 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 7B4CADF2149FE954007E7941 /* Marshmallows */ = {
+ isa = PBXGroup;
+ children = (
+ 7BDCFA05149E69E700DDF1B3 /* MMHTTPClient.h */,
+ 7BDCFA06149E69E700DDF1B3 /* MMHTTPClient.m */,
+ 7BDCFA01149E695E00DDF1B3 /* MMHTTPRequest.h */,
+ 7BDCFA02149E695E00DDF1B3 /* MMHTTPRequest.m */,
+ 7BDCFA09149E6A2A00DDF1B3 /* NSString+marshmallows.h */,
+ 7BDCFA0A149E6A2B00DDF1B3 /* NSString+marshmallows.m */,
+ 7B4CADF3149FEAE5007E7941 /* UIAlertViewDelegate.h */,
+ 7B4CADF4149FEAE5007E7941 /* UIAlertViewDelegate.m */,
+ 7B4CADEE149FE944007E7941 /* UIAlertView+marshmallows.h */,
+ 7B4CADEF149FE944007E7941 /* UIAlertView+marshmallows.m */,
+ );
+ name = Marshmallows;
+ path = 5by5Browser;
+ sourceTree = "<group>";
+ };
7B7302E7149D66EA003547E5 /* Categories */ = {
isa = PBXGroup;
children = (
@@ -232,6 +277,11 @@
7B730303149D6714003547E5 /* MWFeedItem.h in Headers */,
7B730305149D6714003547E5 /* MWFeedParser_Private.h in Headers */,
7B730306149D6714003547E5 /* MWFeedParser.h in Headers */,
+ 7BDCFA03149E695E00DDF1B3 /* MMHTTPRequest.h in Headers */,
+ 7BDCFA07149E69E700DDF1B3 /* MMHTTPClient.h in Headers */,
+ 7BDCFA0B149E6A2B00DDF1B3 /* NSString+marshmallows.h in Headers */,
+ 7B4CADF0149FE944007E7941 /* UIAlertView+marshmallows.h in Headers */,
+ 7B4CADF5149FEAE5007E7941 /* UIAlertViewDelegate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -326,6 +376,11 @@
7B730302149D6714003547E5 /* MWFeedInfo.m in Sources */,
7B730304149D6714003547E5 /* MWFeedItem.m in Sources */,
7B730307149D6714003547E5 /* MWFeedParser.m in Sources */,
+ 7BDCFA04149E695E00DDF1B3 /* MMHTTPRequest.m in Sources */,
+ 7BDCFA08149E69E700DDF1B3 /* MMHTTPClient.m in Sources */,
+ 7BDCFA0C149E6A2B00DDF1B3 /* NSString+marshmallows.m in Sources */,
+ 7B4CADF1149FE944007E7941 /* UIAlertView+marshmallows.m in Sources */,
+ 7B4CADF6149FEAE5007E7941 /* UIAlertViewDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
- <string>${PRODUCT_NAME}</string>
+ <string>5by5 Browser</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
@@ -24,6 +24,8 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleBlackTranslucent</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
View
@@ -7,14 +7,18 @@
//
#import <Foundation/Foundation.h>
+#import "Show.h"
+
+@class Show;
@interface Episode : NSObject
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *number;
+@property (nonatomic, retain) Show *show;
@property (nonatomic, retain) NSURL *url;
-+ (id) episodeWithName: (NSString *)name number: (NSString *)number url: (NSURL *)url;
-- (id) initWithName: (NSString *)name number: (NSString *)number url: (NSURL *)url;
++ (id) episodeWithShow: (Show *)show name: (NSString *)name number: (NSString *)number url: (NSURL *)url;
+- (id) initWithShow: (Show *)show name: (NSString *)name number: (NSString *)number url: (NSURL *)url;
@end
View
@@ -12,22 +12,33 @@ @implementation Episode
@synthesize name = _name;
@synthesize number = _number;
+@synthesize show = _show;
@synthesize url = _url;
-+ (id) episodeWithName: (NSString *)name number: (NSString *)number url: (NSURL *)url
++ (id) episodeWithShow: (Show *)show name: (NSString *)name number: (NSString *)number url: (NSURL *)url
{
- return [[self alloc] initWithName: name number: number url: url];
+ return [[self alloc] initWithShow: show name: name number: number url: url];
}
-- (id) initWithName: (NSString *)name number: (NSString *)number url: (NSURL *)url
+- (id) initWithShow: (Show *)show name: (NSString *)name number: (NSString *)number url: (NSURL *)url
{
self = [super init];
if (self) {
+ self.show = show;
self.name = name;
self.number = number;
self.url = url;
}
return self;
}
+- (void) setName: (NSString *)name
+{
+ if (self.show && [name hasPrefix: self.show.name]) {
+ NSString *showName = [self.show.name stringByAppendingString: @" "];
+ name = [name stringByReplacingOccurrencesOfString: showName withString: @""];
+ }
+ _name = name;
+}
+
@end
View
@@ -0,0 +1,54 @@
+//
+// MMHTTPClient.h
+// Marshmallows
+//
+// Created by Sami Samhuri on 11-09-03.
+// Copyright 2011 Guru Logic. All rights reserved.
+//
+
+#import <UIKit/UIImage.h>
+#import "MMHTTPRequest.h"
+
+@interface MMHTTPClient : NSObject
+{
+ NSString *_baseURL;
+ NSUInteger _timeout;
+}
+
++ (MMHTTPClient *) sharedClient;
++ (id) client;
++ (id) clientWithBaseURL: (NSString *)baseURL;
++ (id) clientWithBaseURL: (NSString *)baseURL timeout: (NSUInteger)timeout;
+
++ (NSString *) pathFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
++ (NSString *) urlFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
++ (NSString *) urlWithPath: (NSString *)path;
++ (MMHTTPRequest *) request: (NSDictionary *)options then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) get: (NSString *)url then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) getImage: (NSString *)url then: (MMHTTPImageCallback)callback;
++ (MMHTTPRequest *) getText: (NSString *)url then: (MMHTTPTextCallback)callback;
++ (MMHTTPRequest *) post: (NSString *)url then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) post: (NSString *)url fields: (NSDictionary *)fields then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) post: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) put: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
++ (MMHTTPRequest *) delete: (NSString *)url then: (MMHTTPCallback)callback;
+
+@property (nonatomic, retain) NSString *baseURL;
+@property NSUInteger timeout;
+
+- (id) initWithBaseURL: (NSString *)baseURl;
+- (id) initWithBaseURL: (NSString *)baseURl timeout: (NSUInteger)timeout;
+- (NSString *) pathFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
+- (NSString *) urlFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
+- (NSString *) urlWithPath: (NSString *)path;
+- (MMHTTPRequest *) request: (NSDictionary *)options then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) get: (NSString *)url then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) getImage: (NSString *)url then: (MMHTTPImageCallback)callback;
+- (MMHTTPRequest *) getText: (NSString *)url then: (MMHTTPTextCallback)callback;
+- (MMHTTPRequest *) post: (NSString *)url then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) post: (NSString *)url fields: (NSDictionary *)fields then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) post: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) put: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
+- (MMHTTPRequest *) delete: (NSString *)url then: (MMHTTPCallback)callback;
+
+@end
Oops, something went wrong.

0 comments on commit ab53861

Please sign in to comment.