```ruby
class Service::AppHarbor < Service
  string :create_build_url
  
  def receive_push
    create_build_url = data['create_build_url']

    raise_config_error 'Missing Create build URL' if create_build_url.to_s.empty?
    raise_config_error 'Invalid Create build URL' unless create_build_url.starts_with? "https://appharbor.com/application/"

    commit = distinct_commits.last
    appharbor_message = {
      :branches => {
        ref_name => {
          :commit_id => commit["id"],
          :commit_message => commit["message"],
          :download_url => commit["url"].sub("commit", "tarball")
        }
      }
    }

    http_post create_build_url, appharbor_message.to_json, 'Accept' => 'application/json'
  end
end
```

Split create build url to an application slug and token
user
```ruby
class Service::AppHarbor < Service
  string :application_slug, :token
  
  def receive_push
    slug = data['application_slug']
    token = data['token']

    create_build_url = "https://appharbor.com/application/#{application_slug}/build?authorization=#{token}"

    raise_config_error 'Missing Create build URL' if create_build_url.to_s.empty?
    raise_config_error 'Invalid Create build URL' unless create_build_url.starts_with? "https://appharbor.com/application/"

    commit = distinct_commits.last
    appharbor_message = {
      :branches => {
        ref_name => {
          :commit_id => commit["id"],
          :commit_message => commit["message"],
          :download_url => commit["url"].sub("commit", "tarball")
        }
      }
    }

    http_post create_build_url, appharbor_message.to_json, 'Accept' => 'application/json'
  end
end
```
assistant