Changeset 3071 for platform/quicksilver/TwitterPlugin
- Timestamp:
- 12/12/07 02:51:09 (13 months ago)
- Location:
- platform/quicksilver/TwitterPlugin
- Files:
-
- 3 modified
-
Info.plist (modified) (1 diff)
-
TwitterPluginAction.h (modified) (1 diff)
-
TwitterPluginAction.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/quicksilver/TwitterPlugin/Info.plist
r3070 r3071 16 16 <string>BNDL</string> 17 17 <key>CFBundleVersion</key> 18 <string> 27</string>18 <string>38</string> 19 19 <key>NSPrincipalClass</key> 20 20 <string>TwitterPlugin</string> -
platform/quicksilver/TwitterPlugin/TwitterPluginAction.h
r3068 r3071 15 15 @interface TwitterPluginAction : QSActionProvider 16 16 { 17 NSData *receivedData;17 id receivedData; 18 18 } 19 19 @end -
platform/quicksilver/TwitterPlugin/TwitterPluginAction.m
r3070 r3071 19 19 20 20 21 NSString *content = @" post from CocoaNSURLRequest.";21 NSString *content = @"status=post_from_Cocoa_NSURLRequest."; 22 22 NSURL *url = [NSURL URLWithString:@"http://user:pass@twitter.com/statuses/update.json"]; 23 23 NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:url]; … … 25 25 [urlRequest setHTTPBody:[content dataUsingEncoding:NSASCIIStringEncoding]]; 26 26 27 NSLog(@"before");28 29 /*30 // create the request31 NSURLRequest *theRequest=[NSURLRequest32 requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]33 cachePolicy:NSURLRequestUseProtocolCachePolicy34 timeoutInterval:60.0];35 // create the connection with the request36 // and start loading the data37 */38 27 NSURLConnection *theConnection = [NSURLConnection 39 28 connectionWithRequest:urlRequest 40 29 delegate:self]; 41 30 if (theConnection) { 42 // Create the NSMutableData that will hold43 // the received data44 // receivedData is declared as a method instance elsewhere45 31 receivedData = [[NSMutableData data] retain]; 46 32 NSLog(@"connected !"); 47 33 } else { 48 34 NSLog(@"not connected correctly."); 49 // inform the user that the download could not be made50 35 } 51 36 … … 60 45 NSLog([dicHead objectForKey:@"Status"]); 61 46 NSLog(@"didReceiveResponse 2"); 62 //abort();47 [receivedData setLength:0]; 63 48 } 64 49 50 - (void) connection : (NSURLConnection *) connection 51 didReceiveData : (NSData *) data { 52 NSLog(@"didReceiveData 1 %d", [data length]); 53 54 [receivedData appendData:data]; 55 56 NSLog(@"didReceiveData 2"); 57 } 58 59 - (void) connection : (NSURLConnection *) connection 60 didFailWithError : (NSError *) error { 61 NSLog(@"didFailWithError 1"); 62 // [connection release]; 63 // [receivedData release]; 64 65 NSLog(@"didFailWithError 2"); 66 } 67 68 - (void) connectionDidFinishLoading:(NSURLConnection *)connection { 69 NSLog(@"connectionDidFinishLoading: succeeded to load %d bytes", [receivedData length]); 70 [(NSData *)receivedData writeToFile:@"/tmp/connectionDidFinishLoading.log" 71 atomically:YES]; 72 // [connection release]; 73 // [receivedData release]; 74 } 65 75 @end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)