Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit a2df4f359e1bb7e0c7eee916a9bf3afde29f0fe9 0 parents
@rvanmelle rvanmelle authored
Showing with 66 additions and 0 deletions.
  1. +11 −0 LICENSE
  2. +55 −0 README.md
11 LICENSE
@@ -0,0 +1,11 @@
+
+Copyright (c) 2011, Brierwood Design Co-operative
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+- Neither the name of Infinite Loop nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 README.md
@@ -0,0 +1,55 @@
+# BRBitly
+
+BRBitly provides an Objective C wrapper class for accessing the free URL shortening services at [bit.ly](http://www.bitly.com) from iOS 4.0 or newer.
+
+# Disclosure
+
+BRBitly was rather brazenly copied and adapted from [ILBitly](https://github.com/InfiniteLoopDK/ILBitly.git). I wanted to use ILBitly directly, but the existing project was already built around ASI and SBJson rather than AFNetwork and JSONkit, so I adapted it to my needs.
+
+## Dependencies
+
+- [ASI HTTP Request](https://github.com/pokeb/asi-http-request) - Used for the underlying network access
+- [SBJson](https://github.com/stig/json-framework.git) - Needed for parsing the response from bit.ly
+- You will also need an account at bit.ly including an [API key](http://bitly.com/a/your_api_key)
+
+
+## Example Usage
+###Shortening an URL
+ BRBitly *bitly = [[BRBitly alloc] initWithLogin:login apiKey:apiKey];
+ [bitly shorten:@"http://www.infinite-loop.dk" result:^(NSString *shortURLString) {
+ NSLog(@"The shortened URL: %@", shortURLString);
+ } error:^(NSError *err) {
+ NSLog(@"An error occurred %@", err);
+ }];
+ [bitly release];
+
+###Expanding an URL
+ [bitly expand:@"http://j.mp/its-your-round" result:^(NSString *longURLString) {
+ NSLog(@"The expanded URL: %@", longURLString);
+ } error:^(NSError *err) {
+ NSLog(@"An error occurred %@", err);
+ }];
+
+###Getting statistics on number of clicks
+ [bitly clicks:@"http://j.mp/qnpNBs" result:^(NSInteger userClicks, NSInteger globalClicks) {
+ NSLog(@"This link has been clicked %d times out of %d clicks globally: %d", userClicks, globalClicks);
+ } error:^(NSError *err) {
+ NSLog(@"An error occurred %@", err);
+ }];
+
+
+See more examples in the attached sample project.
+
+## Building Xcode Documentation
+
+BRBitly is documented in the header files using the appledoc syntax. The sample app contains a target called "Documentation" which will build the documentation and install it for use inside Xcode as a searchable and browsable docset.
+In order to be able to build it you will need to install appledoc on your own computer. You can get appledoc from [GitHub](https://github.com/tomaz/appledoc).
+For more information about how to setup and build the documentation you can read this [short tutorial](http://wp.me/p1xKtH-52).
+
+Feel free to add enhanchements, bug fixes, changes and provide them back to the community!
+
+
+Thanks,
+
+Reid van Melle
+
Please sign in to comment.
Something went wrong with that request. Please try again.