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 +4 -4
- data/lib/plugrush.rb +13 -18
- data/lib/plugrush/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d81ba2b91880e436dfd8a9563d5124a28713343e
|
4
|
+
data.tar.gz: a22f637f48c100d64d01d52bd4380c489a50432c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f16986173b3af7f2a932214abbd7c997849b0eb4010ec3d40fbac122ae35d024daf17ee404dc94d768d8f838905597680cdf6df1fa2941f422ccb5781f6d5ca7
|
7
|
+
data.tar.gz: bd7e5ff8cc1fecf4f69101300b4b377ff65d5e4be45ae4586512037b1d204c34470bbd41f7d947706f36863f945d016e892f103664c6725581310c9924ca1658
|
data/lib/plugrush.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
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
|
26
|
-
get("
|
17
|
+
def campaign_list
|
18
|
+
self.class.get("#{@credentials}&action=campaign/list")
|
27
19
|
end
|
28
20
|
|
29
|
-
def
|
30
|
-
get("
|
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
|
data/lib/plugrush/version.rb
CHANGED