Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

TumblrKit is a Cocoa interface for Tumblr

branch: master

Updates project file to Xcode 4.4.

latest commit 6e7334240a
Igor Sutton Lopes authored
Octocat-spinner-32 .idea Added TumblrKit Tests for iOS May 31, 2012
Octocat-spinner-32 English.lproj initial import. July 14, 2010
Octocat-spinner-32 TumblrKit Tests for Mac Introduced ARC support May 30, 2012
Octocat-spinner-32 TumblrKit Tests for iOS Added tests. Also fixed some warnings. May 31, 2012
Octocat-spinner-32 TumblrKit for Mac Added iOS and Mac targets December 13, 2011
Octocat-spinner-32 TumblrKit for iOS Added iOS and Mac targets December 13, 2011
Octocat-spinner-32 TumblrKit.xcodeproj Updates project file to Xcode 4.4. July 31, 2012
Octocat-spinner-32 .gitignore Added iOS and Mac targets December 13, 2011
Octocat-spinner-32 Info.plist Changed license to MIT January 13, 2011
Octocat-spinner-32 MIT-LICENSE.txt Changed license to MIT January 13, 2011
Octocat-spinner-32 NSDictionary+TumblrKit.h Added iOS and Mac targets December 13, 2011
Octocat-spinner-32 NSDictionary+TumblrKit.m Using \r\n instead of \n January 14, 2011
Octocat-spinner-32 NSString+TumblrKit.h Changed license to MIT January 13, 2011
Octocat-spinner-32 NSString+TumblrKit.m Introduced ARC support May 30, 2012
Octocat-spinner-32 README.md Updated README.md January 14, 2011
Octocat-spinner-32 TKPost.h Added TumblrKit Tests for iOS May 31, 2012
Octocat-spinner-32 TKPost.m Added TumblrKit Tests for iOS May 31, 2012
Octocat-spinner-32 TKPostsRequest.h Added TumblrKit Tests for iOS May 31, 2012
Octocat-spinner-32 TKPostsRequest.m Ignores arc-performSelector-leaks messages. July 31, 2012
Octocat-spinner-32 TKPostsResponse.h Introduced ARC support May 30, 2012
Octocat-spinner-32 TKPostsResponse.m Introduced ARC support May 30, 2012
Octocat-spinner-32 TKRequest.h Moving towards a more framework-ish way. December 15, 2011
Octocat-spinner-32 TKRequest.m Added tests. Also fixed some warnings. May 31, 2012
Octocat-spinner-32 TKTumblelog.h Introduced ARC support May 30, 2012
Octocat-spinner-32 TKTumblelog.m Introduced ARC support May 30, 2012
Octocat-spinner-32 TKTumblelogsRequest.h Added tests. Also fixed some warnings. May 31, 2012
Octocat-spinner-32 TKTumblelogsRequest.m Added tests. Also fixed some warnings. May 31, 2012
Octocat-spinner-32 TKTumblelogsResponse.h Introduced ARC support May 30, 2012
Octocat-spinner-32 TKTumblelogsResponse.m Introduced ARC support May 30, 2012
Octocat-spinner-32 TKTumblr.h Introduced ARC support May 30, 2012
Octocat-spinner-32 TKTumblr.m Fixes Content-Length string format argument. July 31, 2012
Octocat-spinner-32 TKTumblrReadRequest.h Changed license to MIT January 13, 2011
Octocat-spinner-32 TKTumblrReadRequest.m Introduced ARC support May 30, 2012
Octocat-spinner-32 doxygen.config added doxygen configuration file September 07, 2010
README.md

TumblrKit

TumblrKit is a light-weight wrapper around Tumblr's API in Objective-C.

Currently you can:

  • Fetch posts from Tumblr (regular, conversation, quote and link)
  • Upload posts to Tumblr (regular, conversation, quote, link and photo)

Usage

You can fetch a post with a specific POST_ID using the following:

TKTumblr *tumblr = [[TKTumblr alloc] initWithEmail:EMAIL andPassword:PASSWORD];
TKPost *thePost = [tumblr postWithID:[NSNumber numberWithInt:POST_ID] andDomain:@"example.tumblr.com"];
NSLog(@"thePost: %@", thePost);

If you want to fetch more than one post:

// Instantiate a new TKTumblr object.
TKTumblr *tumblr = [[TKTumblr alloc] initWithEmail:EMAIL andPassword:PASSWORD];

// Configure a delegate implementing the TKTumblrDelegate protocol.
tumblr.delegate = aDelegate;

// Configure the read request object.
TKTumblrReadRequest *theReadRequest = [[TKTumblrReadRequest alloc] init];

// Return the post in raw text (if you wrote using Markdown).
theReadRequest.filter = TKPostFilterNone;

// Execute the read request. For each post, TKTumblr will send the
// tumblrDidReceivePost:withDomain: message to the delegate object.
[tumblr postsWithReadRequest:theReadRequest];

To upload a TKPost:

// Create a new TKPost
TKPostRegular *thePost = [[TKPostRegular alloc] init];
thePost.title = @"The title";
thePost.body = @"The body";

// Upload it to Tumblr. The delegate will receive either
// tumblrDidUploadPost:withDomain:postId: or
// tumblrDidFailToUploadPost:withDomain:returnCode:
[tumblr uploadPost:thePost withDomain:@"another-example.tumblr.com"];

// If you're lazy, you can dismiss the withDomain to upload to your main
// Tumblelog.
[tumblr uploadPost:thePost];

To Do

  • Currently network connections are synchronous. Need to add support for asynchronous connections, and respective delegate methods.
Something went wrong with that request. Please try again.