Sha256: 9753b508ca28d0a0d06530b45fc58e3c3db05d84fa2b6b6f48750e7aa1bcdaa0

Contents?: true

Size: 528 Bytes

Versions: 2

Compression:

Stored size: 528 Bytes

Contents

require 'lib/em-synchrony'

require "em-synchrony/em-bitly"
EM.synchrony do
  bitly = Bitly.new('[INSERT_LOGIN]', '[INSERT_API_KEY]')
  url = 'http://github.com/igrigorik/em-synchrony'
  short = bitly.shorten(url)

  p "Short #{url} => #{short.jmp_url}"
  EM.stop
end


Bitly.use_api_version_3
EM.synchrony do
  bitly = Bitly.new('[INSERT_LOGIN]', '[INSERT_API_KEY]')

  url = 'http://github.com/igrigorik/em-synchrony'
  domain='nyti.ms'

  pro = bitly.bitly_pro_domain(domain)
  p "Domain #{domain} pro=#{pro}"

  EM.stop
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
em-synchrony-0.3.0.beta.1 examples/bitly.rb
em-synchrony-0.2.0 examples/bitly.rb