This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem "json" | |
gem "uuid" | |
gem "ruby-hmac" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<api xmlns="http://mashape.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://mashape.com mashape-4.0.xsd "> | |
<authentication type="header"> | |
<description><![CDATA[This is a simple header authentication]]></description> | |
<parameters> | |
<parameter name="X-Pippo-Username" optional="false"> | |
<description><![CDATA[Please enter here your username]]></description> | |
</parameter> | |
<parameter name="X-Pippo-Password" optional="false"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Bitly; | |
[..] | |
// and when you are ready to use it just create a new instance! | |
Bitly client = new Bitly("MY_PUBLIC_KEY", "MY_PRIVATE_KEY"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bitly client = new Bitly("MY_PUBLIC_KEY", "MY_PRIVATE_KEY"); | |
JSONObject result = client.getShortenedUrl(originalUrl, login, apikey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bitly import Bitly | |
obj = Bitly("MY_PUBLIC_KEY", "MY_PRIVATE_KEY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bitly import Bitly | |
obj = Bitly("MY_PUBLIC_KEY", "MY_PRIVATE_KEY") | |
def my_function(result): | |
print result | |
obj.getShortenedUrl("http://mashape.com", "mashape", "apikey", my_function) | |
print "waiting" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "Bitly.rb" | |
obj = Bitly.new("MY_PUBLIC_KEY", "MY_PRIVATE_KEY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Sample.h" | |
@implementation Sample | |
- (void) doAPIRequest { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
@try { | |
// Initialize the Obj-C Client Library with a Developer key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
// Call a method asynchronously and get a Thread object | |
Thread thread = bitly.getShortenedUrl("http://www.mashape.com", "bitly-login", "bitly-api-key", new MashapeCallback() { | |
@Override | |
public void requestCompleted(Object response) { | |
JSONObject jsonResponse = (JSONObject) response; | |
System.out.println("Finally the shortened url is " + jsonResponse.getString("shortenedUrl")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
# Call a method asynchronously and get a Thread object | |
thread = bitly.getShortenedUrl("http://www.mashape.com", "bitly-login", "bitly-api-key") { |response| | |
shortenedUrl = response["shortenedUrl"] # See the API's documentation | |
puts "Finally the shortened url is " + shortenedUrl | |
} | |
=begin |
OlderNewer