This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :deploy do | |
| desc "Runs db:seed" | |
| task :seed_data do | |
| run "cd #{current_path} && #{try_sudo} #{rake} db:seed" | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-17074221-1']); | |
| _gaq.push(['_setDomainName', 'none']); | |
| _gaq.push(['_setAllowLinker', true]); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| platform :ios, "5.0" | |
| pod "AFNetworking" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <UIKit/UIKit.h> | |
| @interface WPViewController : UITableViewController | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface WPViewController () | |
| @property (nonatomic, strong) NSArray *posts; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| #import "AFNetworking.h" | |
| @interface WPApi : AFHTTPClient | |
| + (WPApi *)sharedApi; | |
| - (void)getPostsWithSuccess:(void (^)(NSArray *))successBlock | |
| failure:(void (^)(NSError *))failureBlock; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| @interface WPAtomHandler : NSObject <NSXMLParserDelegate> | |
| -(NSArray *)entries; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)getPostsWithSuccess:(void (^)(NSArray *))successBlock | |
| failure:(void (^)(NSError *))failureBlock | |
| { | |
| [self getPath:@"feed/atom/" parameters:nil | |
| success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
| if (successBlock) { | |
| NSXMLParser *parser = [[NSXMLParser alloc] initWithData:responseObject]; | |
| WPAtomHandler *handler = [[WPAtomHandler alloc] init]; | |
| parser.delegate = handler; | |
| [parser parse]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| [[WPApi sharedApi] | |
| getPostsWithSuccess:^(NSArray *entries) { | |
| self.posts = entries; | |
| [self.tableView reloadData]; | |
| } | |
| failure:^(NSError *error) { | |
| [[[UIAlertView alloc] initWithTitle:@"Error!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| @interface WPPostViewController : UIViewController | |
| @property (nonatomic, strong) NSString *postText; | |
| @property (nonatomic, strong) NSString *postTitle; | |
| @end |