Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
remove contentDate metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Kim authored and Jason Kim committed Jul 23, 2015
1 parent 5a01338 commit f88619f
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 65 deletions.
1 change: 0 additions & 1 deletion Resources/create_page_with_business_cards.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title>A page with auto-extracted business card from an image</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with an extracted business card from an image</h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_image.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<html><head>
<title>A simple page created with an embedded image</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with an image on it</h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_note_tags.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title data-tag="to-do:completed">A page created with note tags</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1 data-tag="important">Paragraphs with predefined note tags</h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_pdf.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<html>
<head><title>A page created with a file attachment</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with a pdf file attachment</h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_product_info.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title>A page with auto-extracted product info from a URL</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with an extracted product info from a URL: http://www.amazon.com/Xbox-One/dp/B00KAI3KW2 </h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_recipe.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title>A page with auto-extracted recipe from a URL</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with an extracted recipe from a URL: http://allrecipes.com/Recipe/Homemade-Mac-and-Cheese </h1>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_url_snapshot.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title>A page created with an image from a URL on it</title>
<meta name="created" content="{contentDate}"/>
</head>
<body><p>This is a page with an image of an html page rendered from a URL on it.</p>
<img data-render-src="http://www.onenote.com" alt="An important web page"/></body>
Expand Down
1 change: 0 additions & 1 deletion Resources/create_page_with_web_snap.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<title>A page created with an image of an html page on it</title>
<meta name="created" content="{contentDate}"/>
</head>
<body>
<h1>This is a page with an image of an html page on it.</h1>
Expand Down
2 changes: 1 addition & 1 deletion iOS-REST-API-Explorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

/* Begin PBXFileReference section */
854A3998C333805F74F8CA48 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
960C1FCB1B3B639700918D53 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; };
960C1FCB1B3B639700918D53 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
961E871C1B44B20600060961 /* AuthHelperDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthHelperDelegate.h; sourceTree = "<group>"; };
963E9EE71B38C50400D57EAA /* iOS-REST-API-Explorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS-REST-API-Explorer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
963E9EEB1B38C50400D57EAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down
2 changes: 1 addition & 1 deletion iOS-REST-API-Explorer/DetailTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ - (IBAction)runTapped:(id)sender {

[self.tableView reloadData];
} failure:^(id responseObject) {
self.responseBody = responseObject;
self.responseBody = [(NSError *)responseObject localizedDescription];

self.tableView.tableHeaderView = nil;
[self.tableView reloadData];
Expand Down
62 changes: 7 additions & 55 deletions iOS-REST-API-Explorer/OneNoteManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,6 @@ - (Operation*) createSimplePage{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"simple_page" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];



Operation *operation = [[Operation alloc] initWithOperationName:@"POST: Create a simple page using HTML"
urlString:[self createURLString:[NSString stringWithFormat:@"me/notes/sections/{%@}/pages", ParamsSectionIDKey]]
Expand Down Expand Up @@ -260,11 +253,7 @@ - (Operation*) createPageWithImage{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_image" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];

MultiformObject *htmlPart = [[MultiformObject alloc] init];

htmlPart.body = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
Expand All @@ -273,7 +262,7 @@ - (Operation*) createPageWithImage{

MultiformObject *imagePart = [[MultiformObject alloc] init];

imagePart.body = UIImageJPEGRepresentation([UIImage imageNamed:@"logo.png"], 1.0f);
imagePart.body = UIImageJPEGRepresentation([UIImage imageNamed:@"logo.jpg"], 1.0f);
imagePart.headers = @{@"Content-Disposition":@"form-data; name=\"image1\"",
@"Content-type":@"image/jpeg"};

Expand All @@ -297,11 +286,7 @@ - (Operation*) createPageWithWebPageSnapshot{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_web_snap" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];

MultiformObject *htmlPart = [[MultiformObject alloc] init];

htmlPart.body = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
Expand Down Expand Up @@ -335,14 +320,7 @@ - (Operation*) createPageWithURLSnapshot{

// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_url_snapshot" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];


NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];

Operation *operation = [[Operation alloc] initWithOperationName:@"POST: Page with a snapshot of a URL"
urlString:[self createURLString:[NSString stringWithFormat:@"me/notes/sections/{%@}/pages", ParamsSectionIDKey]]
Expand All @@ -368,11 +346,7 @@ - (Operation*) createPageWithPDF{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_pdf" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];

MultiformObject *htmlPart = [[MultiformObject alloc] init];

htmlPart.body = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
Expand Down Expand Up @@ -405,12 +379,6 @@ - (Operation*) createPageWithNotetags{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_note_tags" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];


Operation *operation = [[Operation alloc] initWithOperationName:@"POST: Page with a notetags"
urlString:[self createURLString:[NSString stringWithFormat:@"me/notes/sections/{%@}/pages", ParamsSectionIDKey]]
Expand All @@ -435,11 +403,7 @@ - (Operation*) createPageWithBusinessCard{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_business_cards" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];

MultiformObject *htmlPart = [[MultiformObject alloc] init];

htmlPart.body = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
Expand Down Expand Up @@ -473,13 +437,7 @@ - (Operation*) createPageWithRecipe{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_recipe" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];



Operation *operation = [[Operation alloc] initWithOperationName:@"POST: Page with a recipe"
urlString:[self createURLString:[NSString stringWithFormat:@"me/notes/sections/{%@}/pages", ParamsSectionIDKey]]
operationType:OperationPostCustom
Expand All @@ -503,12 +461,6 @@ - (Operation*) createPageWithProductInfo{
// Sample HTML Content here
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"create_page_with_product_info" ofType:@"html" ];
NSMutableString *htmlString = [NSMutableString stringWithString:[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]];
NSString *dateString = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterFullStyle];

[htmlString replaceOccurrencesOfString:@"{contentDate}" withString:dateString options:NSLiteralSearch range:NSMakeRange(0, [dateString length])];


Operation *operation = [[Operation alloc] initWithOperationName:@"POST: Page with a product info"
urlString:[self createURLString:[NSString stringWithFormat:@"me/notes/sections/{%@}/pages", ParamsSectionIDKey]]
Expand Down

0 comments on commit f88619f

Please sign in to comment.