dsp 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04065820abd2deee12f8f9f9c375f319ad169a29
4
- data.tar.gz: 0ef26c26ac603c1a954753becf3edcd54daa411c
3
+ metadata.gz: 82d4835b9f6e01e0b94c5eaef086b78bf2f78f0f
4
+ data.tar.gz: fc36ce71cdf17f682e76b1b2ac65ef5478633cbe
5
5
  SHA512:
6
- metadata.gz: 94a84935757a4a04ec76661737df7f1f867c1e1d2fb49a11e48da7ab311754094fb4ed0ee2035cf3501842bf95fe0f1c668bd67171da9dfef43a38cade5b2c80
7
- data.tar.gz: 86a24c65a9134207074f27fdbf739a3e01e385ae2f8a7be013791606ff6043e0c81193d0d99098d0a3838ff85c5a61298de417e018dcf1a6d1c8f4cfa5fe1186
6
+ metadata.gz: cf599330a35fa473d1c28af442d8392c40d437018fe3cfa36d7bdc1e57197270823822dfa335da6d37b991a17175e5ed34a5adabab96082d099e13ba6b7a5637
7
+ data.tar.gz: 9fc5fe7b098a3ac98966ef1033cfcb282958176871998079210f07be0284182e8b80424ff8fc5ce4072a2c31b7d795b94a71007c88f840f7581dd8e22f389bec
data/.gitignore CHANGED
@@ -1 +0,0 @@
1
- *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://ruby.taobao.org'
2
+
3
+ gem 'rspec' , '>= 3.3.0'
4
+ gem 'httparty' , '>= 0.13.7'
@@ -0,0 +1,32 @@
1
+ GEM
2
+ remote: http://ruby.taobao.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ httparty (0.13.7)
6
+ json (~> 1.8)
7
+ multi_xml (>= 0.5.2)
8
+ json (1.8.3)
9
+ multi_xml (0.5.5)
10
+ rspec (3.3.0)
11
+ rspec-core (~> 3.3.0)
12
+ rspec-expectations (~> 3.3.0)
13
+ rspec-mocks (~> 3.3.0)
14
+ rspec-core (3.3.2)
15
+ rspec-support (~> 3.3.0)
16
+ rspec-expectations (3.3.1)
17
+ diff-lcs (>= 1.2.0, < 2.0)
18
+ rspec-support (~> 3.3.0)
19
+ rspec-mocks (3.3.2)
20
+ diff-lcs (>= 1.2.0, < 2.0)
21
+ rspec-support (~> 3.3.0)
22
+ rspec-support (3.3.0)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ httparty (>= 0.13.7)
29
+ rspec (>= 3.3.0)
30
+
31
+ BUNDLED WITH
32
+ 1.10.6
@@ -0,0 +1,51 @@
1
+
2
+ 腾讯DSPruby接口
3
+ ======
4
+
5
+ > [sudo] gem install dsp
6
+
7
+ 账号
8
+ ----
9
+
10
+ * 设置mapping url【set_mapping_url】
11
+ `::DSP::API::Account.set_mapping_url('http://www.baidu.com')`
12
+
13
+ * 设置bid url【set_bid_url】
14
+
15
+ * 设置win notice url【set_win_notice_url】
16
+
17
+ * 设置qps【set_qps】 `::DSP::API::Account.set_qps('http://www.baidu.com')`
18
+
19
+ * 设置no cm response【set_no_cm_response】 `::DSP::API::Account.set_no_cm_response(true)`
20
+
21
+ * 设置use tuserinfo【set_use_tuserinfo】 `::DSP::API::Account.set_use_tuserinfo(true)`
22
+
23
+ 广告信息同步
24
+ ----
25
+
26
+ `::DSP::API::AdsInfoSync.download`
27
+
28
+ 广告状态
29
+ ----
30
+
31
+ `::DSP::API::AdsStatus.download(广告ID)`
32
+
33
+ 非法广告
34
+ ----
35
+
36
+ `::DSP::API::IllegalAds.download(date = "YYYY-MM-DD")`
37
+
38
+ 报表
39
+ ----
40
+
41
+ `::DSP::API::Report.download('开始日期2015-10-01', '结束日期2015-10-06')`
42
+ 报表下载, 开始日期和结束日期相差不超过7天
43
+
44
+ 上传广告信息
45
+ ----
46
+
47
+ `::DSP::API::UploadAdsInfo.upload(options={})`
48
+
49
+ example:
50
+ `::DSP::API::UploadAdsInfo.upload(file_url: 'http://dsp.hogic.cn/Public/Uploads/201508/55e00f321ba3c.flv', dsp_order_id: 123, client_name: '浩趣互动', targeting_url: 'http://dsp.hogic.cn', monitor_url: [])`
51
+
@@ -9,12 +9,12 @@ Gem::Specification.new do |spec|
9
9
  spec.version = DSP::VERSION
10
10
  spec.authors = ["姚露"]
11
11
  spec.email = ["y1150264176@163.com"]
12
- spec.summary = %q{dsp}
13
- spec.description = %q{dsp}
12
+ spec.summary = %q{dsp update}
13
+ spec.description = %q{dsp update}
14
14
  spec.homepage = ""
15
15
  spec.license = "GNU"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0")
17
+ spec.files = `git ls-files`.split("\n")
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
data/lib/dsp.rb CHANGED
@@ -6,7 +6,7 @@ module DSP
6
6
  autoload :API , 'dsp/api'
7
7
  autoload :BID , 'dsp/bid'
8
8
 
9
- VERSION='0.0.1'
9
+ VERSION='0.0.2'
10
10
 
11
11
  AUTH = {dsp_id: 190, token: '73553e669b7270a4934706f76a99ad36'}
12
12
  ADX_URL = 'http://opentest.adx.qq.com'
@@ -4,15 +4,16 @@ module DSP
4
4
  class UploadAdsInfo
5
5
  @@target_url = "#{DSP::ADX_URL}/order/sync"
6
6
  class << self
7
- def upload(file_url = '', dsp_order_id = Time.now.to_i)
7
+ # def upload(file_url = '', dsp_order_id = Time.now.to_i)
8
+ def upload(options = {})
8
9
  order_info = [{
9
- "dsp_order_id"=> "#{dsp_order_id}",
10
- "client_name"=> "浩趣互动",
10
+ "dsp_order_id"=> "#{options[:dsp_order_id]}",
11
+ "client_name"=> "#{options[:client_name]}",
11
12
  "file_info"=> [{
12
- "file_url"=> "#{file_url}"
13
+ "file_url"=> "#{options[:file_url]}"
13
14
  }],
14
- "targeting_url"=> "http://#{URI(file_url).host}" ,
15
- "monitor_url"=> []
15
+ "targeting_url"=> "#{options[:targeting_url]}" ,
16
+ "monitor_url"=> options[:monitor_url]
16
17
  }].to_json
17
18
  body = {order_info: order_info}.merge(DSP::AUTH)
18
19
  req = HTTParty.post(@@target_url, body: body).body
@@ -8,7 +8,7 @@ describe ::DSP::API::UploadAdsInfo do
8
8
 
9
9
  context '#upload' do
10
10
  it 'upload ads info and return ret_code == 0 if success' do
11
- res = ::DSP::API::UploadAdsInfo.upload('http://dsp.hogic.cn/Public/Uploads/201508/55e00f321ba3c.flv', 123)
11
+ res = ::DSP::API::UploadAdsInfo.upload(file_url: 'http://dsp.hogic.cn/Public/Uploads/201508/55e00f321ba3c.flv', dsp_order_id: 123, client_name: '浩趣互动', targeting_url: 'http://dsp.hogic.cn', monitor_url: [])
12
12
  expect(res["ret_code"]).to eq 0
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "姚露"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.7
27
- description: dsp
27
+ description: dsp update
28
28
  email:
29
29
  - y1150264176@163.com
30
30
  executables: []
@@ -33,7 +33,9 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - ".gitignore"
35
35
  - ".rspec"
36
- - README
36
+ - Gemfile
37
+ - Gemfile.lock
38
+ - README.md
37
39
  - dsp.gemspec
38
40
  - lib/dsp.rb
39
41
  - lib/dsp/api.rb
@@ -74,7 +76,7 @@ rubyforge_project:
74
76
  rubygems_version: 2.4.5.1
75
77
  signing_key:
76
78
  specification_version: 4
77
- summary: dsp
79
+ summary: dsp update
78
80
  test_files:
79
81
  - spec/api/ads_info_sync_spec.rb
80
82
  - spec/api/ads_stauts_spec.rb
data/README DELETED
File without changes