Giter VIP home page Giter VIP logo

tumblrkit's Introduction

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.

tumblrkit's People

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.