plugrush 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: d2bb90fad5be9ea70dd0ec1257987d66da22d4f2
4
- data.tar.gz: 93b6c87614476e8172d5501f2ec2b2bc6fc0b945
3
+ metadata.gz: d81ba2b91880e436dfd8a9563d5124a28713343e
4
+ data.tar.gz: a22f637f48c100d64d01d52bd4380c489a50432c
5
5
  SHA512:
6
- metadata.gz: f777eb963e6f56996fc6948ed4302023d0db2cf0d360b4ff23499abf5c26db26d04374038075e785d0d9137e1ebd547de0d94d46ccec12c8094c5f81e4e24627
7
- data.tar.gz: 0787491c125578bd08c1d136786e58de5bf65df1f2ce7b6a4dd44185281927be6ed20da779e6e9a52ec9ca80ff80f6642f735afd9f5aa2697a148ac7c5aba856
6
+ metadata.gz: f16986173b3af7f2a932214abbd7c997849b0eb4010ec3d40fbac122ae35d024daf17ee404dc94d768d8f838905597680cdf6df1fa2941f422ccb5781f6d5ca7
7
+ data.tar.gz: bd7e5ff8cc1fecf4f69101300b4b377ff65d5e4be45ae4586512037b1d204c34470bbd41f7d947706f36863f945d016e892f103664c6725581310c9924ca1658
@@ -1,34 +1,29 @@
1
1
  require "plugrush/version"
2
2
  require "httparty"
3
3
 
4
-
5
-
6
- module Plugrush
4
+ class Plugrush
7
5
  include HTTParty
8
6
  default_options.update(verify: false)
9
7
  base_uri "https://www.plugrush.com/api"
10
-
11
- # "advertiser/stats"
12
- def self.stats_on_date(email, api_key, start_date, end_date)
13
- get("?user=#{email}&api_key=#{api_key}&action=advertiser/stats&start=#{start_date}&end=#{end_date}&breakdown=dates")
8
+ def initialize(email, api_key)
9
+ @credentials = "?user=#{email}&api_key=#{api_key}"
14
10
  end
15
11
 
16
12
 
17
- # "campaign/pause"
18
- #https://www.plugrush.com/api
19
- #?user=mail@domain.com
20
- #&api_key=o34ting43oitfgn4ofinoi
21
- #&action=campaign/pause
22
- #&id=123456
23
- #&pause=1
13
+ def stats_on_date(start_date, end_date)
14
+ self.class.get("#{@credentials}&action=advertiser/stats&start=#{start_date}&end=#{end_date}&breakdown=dates")
15
+ end
24
16
 
25
- def self.stop(email, api_key, campaign_id)
26
- get("?user=#{email}&api_key=#{api_key}&action=campaign/pause&id=#{campaign_id}&pause=1")
17
+ def campaign_list
18
+ self.class.get("#{@credentials}&action=campaign/list")
27
19
  end
28
20
 
29
- def self.start(email, api_key, campaign_id)
30
- get("?user=#{email}&api_key=#{api_key}&action=campaign/pause&id=#{campaign_id}&pause=0")
21
+ def stop(campaign_id)
22
+ self.class.get("#{@credentials}&action=campaign/pause&id=#{campaign_id}&pause=1")
31
23
  end
32
24
 
25
+ def start(campaign_id)
26
+ self.class.get("#{@credentials}&action=campaign/pause&id=#{campaign_id}&pause=0")
27
+ end
33
28
 
34
29
  end
@@ -1,3 +1,3 @@
1
1
  module Plugrush
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plugrush
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
  - Stefan Maier