class Adfly::API

Unofficial API Wrapper for adf.ly

Constants

URL_API

Unique url API

Public Class Methods

new(uid, key) click to toggle source

Create instance to use API adfly

If you want to get API key from adf.ly/publisher/tools#tools-api

@param uid [String] Uid @param key [String] Key

# File lib/adfly/adfly.rb, line 17
def initialize uid, key
  @uid, @key = uid, key
end

Public Instance Methods

Private Instance Methods

http_get(url, data) click to toggle source
# File lib/adfly/adfly.rb, line 45
def http_get url, data
  uri = URI(url)
  uri.query = URI.encode_www_form(data)

  res = Net::HTTP.get_response(uri)
  res.body
end