Permalink
Browse files

Merge branch 'master' of git://github.com/laiso/hatena-touch into lai…

…so/master
  • Loading branch information...
kishikawakatsumi committed Aug 29, 2009
2 parents 10fd1ff + 0479275 commit 77ca9db0966412db9816156f05d44dae87187990
View
@@ -340,12 +340,9 @@ - (NSData *)requestMyBookmarkFeed {
}
- (NSData *)requestMyBookmarkFeed:(NSInteger)offset {
- HatenaTouchAppDelegate *hatenaTouchApp = [HatenaTouchAppDelegate sharedHatenaTouchApp];
- UserSettings *userSettings = hatenaTouchApp.userSettings;
- NSString *userName = userSettings.userName;
- NSMutableURLRequest *req = [self makeRequestWithURI:[NSString stringWithFormat:@"http://b.hatena.ne.jp/%@/atomfeed?of=%d", userName, offset]
+ NSMutableURLRequest *req = [self makeRequestWithURI:[NSString stringWithFormat:@"http://b.hatena.ne.jp/atom/feed?of=%d", offset]
method:@"GET"];
-
+
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSData *data;
@@ -41,16 +41,15 @@ - (void)dealloc {
- (void)_loadPageInfo {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSURL *webServiceURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://b.hatena.ne.jp/entry/json/%@", pageURL]];
+ NSURL *webServiceURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://b.hatena.ne.jp/entry/jsonlite/%@", pageURL]];
NSURLRequest *req = [NSURLRequest requestWithURL:webServiceURL cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30];
NSData *data;
NSHTTPURLResponse *res;
NSError *error;
data = [NSURLConnection sendSynchronousRequest:req returningResponse:&res error:&error];
-
- NSString *temp = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
- NSString *json = [[temp substringFromIndex:1] substringToIndex:[temp length] -2];
+
+ NSString *json = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
pageInfo = [[json JSONValue] retain];
[[[self navigationItem] rightBarButtonItem] setEnabled:YES];
@@ -0,0 +1,24 @@
+diff --git a/Classes/WebViewController.m b/Classes/WebViewController.m
+index b7228e2..e54e029 100644
+--- a/Classes/WebViewController.m
++++ b/Classes/WebViewController.m
+@@ -42,16 +42,15 @@ static NSObject *webViewcreateWebViewWithRequestIMP(id self, SEL _cmd, NSObject*
+ - (void)_loadPageInfo {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+- NSURL *webServiceURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://b.hatena.ne.jp/entry/json/%@", pageURL]];
++ NSURL *webServiceURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://b.hatena.ne.jp/entry/jsonlite/%@", pageURL]];
+ NSURLRequest *req = [NSURLRequest requestWithURL:webServiceURL cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30];
+
+ NSData *data;
+ NSHTTPURLResponse *res;
+ NSError *error;
+ data = [NSURLConnection sendSynchronousRequest:req returningResponse:&res error:&error];
+-
+- NSString *temp = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
+- NSString *json = [[temp substringFromIndex:1] substringToIndex:[temp length] -2];
++
++ NSString *json = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
+ pageInfo = [[json JSONValue] retain];
+
+ [[[self navigationItem] rightBarButtonItem] setEnabled:YES];
@@ -0,0 +1,20 @@
+diff --git a/Classes/HatenaAtomPub.m b/Classes/HatenaAtomPub.m
+index bd7ee47..9d1787d 100644
+--- a/Classes/HatenaAtomPub.m
++++ b/Classes/HatenaAtomPub.m
+@@ -340,12 +340,9 @@
+ }
+
+ - (NSData *)requestMyBookmarkFeed:(NSInteger)offset {
+- HatenaTouchAppDelegate *hatenaTouchApp = [HatenaTouchAppDelegate sharedHatenaTouchApp];
+- UserSettings *userSettings = hatenaTouchApp.userSettings;
+- NSString *userName = userSettings.userName;
+- NSMutableURLRequest *req = [self makeRequestWithURI:[NSString stringWithFormat:@"http://b.hatena.ne.jp/%@/atomfeed?of=%d", userName, offset]
++ NSMutableURLRequest *req = [self makeRequestWithURI:[NSString stringWithFormat:@"http://b.hatena.ne.jp/atom/feed?of=%d", offset]
+ method:@"GET"];
+-
++
+ [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
+
+ NSData *data;
+

0 comments on commit 77ca9db

Please sign in to comment.