rails-pinterest 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1fc96a443db45b6ac15f51c8152b6e87145b1c6dacb58d5b465b2d8a69f8b82
4
- data.tar.gz: 6ea256a6db07492035e6e622f4cb7e5617792ef3963ec7a1e452a9406a7279ef
3
+ metadata.gz: 8aab3135f3b808a0275ebf74d586cd5c5d10c8adf00c742dd5774160dbd2fca7
4
+ data.tar.gz: d22b0aa38454c2bf9f3a9c2b90da90167a187b0980ee5c55241b89518c1d31a6
5
5
  SHA512:
6
- metadata.gz: 12bad857ab4b1aec512620322dc720c0e04243537279cad50c5be6242208c2aa3a264ef0ac82cbd87892da2f5276a7d7993f501d0fdac397718e0a0a580653a8
7
- data.tar.gz: 8c3a3ac50db6366fa37df5d5aacff6d8e556aa6545bbb7350c650ceb7096efa8999869427c7798773b7022cb559183f230167490330d4c6422d473ea2f355db7
6
+ metadata.gz: 3f5537f6e8f1fc2730c271058b48bc8e1c9d2403a0de760f8f994b66e073c8f0ce4ceb87de7d0f60e5eedfccd418fcb07288141e517beab5a1c9e7d7c3803778
7
+ data.tar.gz: dc2870525a7a25bbb42979b86f7c999561fe0ed6bd64da4aad93af267f3838c482de0233b4a22023b9dbdf811dceb750dc7ab146ef09c979e2049d415b731dc8
data/CHANGELOG.md CHANGED
@@ -14,4 +14,7 @@
14
14
  - Added oauth refresh token endpoint.
15
15
 
16
16
  ## [0.1.3] - 2023-12-2
17
- - Add to ReadMe how to get access token from a authorization token
17
+ - Add to ReadMe how to get access token from a authorization token
18
+
19
+ ## [0.1.4] - 2024-01-17
20
+ - Add keywords and terms to API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-pinterest (0.1.3)
4
+ rails-pinterest (0.1.4)
5
5
  faraday (>= 1)
6
6
  faraday-multipart (>= 1)
7
7
 
@@ -73,6 +73,7 @@ GEM
73
73
 
74
74
  PLATFORMS
75
75
  x86_64-darwin-19
76
+ x86_64-darwin-23
76
77
 
77
78
  DEPENDENCIES
78
79
  byebug (~> 11.1.3)
@@ -31,6 +31,14 @@ module Pinterest
31
31
  @pins ||= Pinterest::Pins.new(client: self)
32
32
  end
33
33
 
34
+ def terms
35
+ @terms ||= Pinterest::Pins.new(client: self)
36
+ end
37
+
38
+ def keywords
39
+ @pins ||= Pinterest::Keywords.new(client: self)
40
+ end
41
+
34
42
  def oauth
35
43
  @oauth ||= Pinterest::Oauth.new(client: self)
36
44
  end
@@ -0,0 +1,30 @@
1
+ module Pinterest
2
+ class Keywords
3
+ def initialize(client: nil)
4
+ @client = client
5
+ end
6
+
7
+ def get_keywords(ad_account_id:, parameters: {})
8
+ @client.get(path: "/ad_accounts/#{ad_account_id}/keywords", parameters: parameters)
9
+ end
10
+
11
+ def create_keywords(ad_account_id:, parameters: {})
12
+ @client.json_post(path: "/ad_accounts/#{ad_account_id}/keywords", parameters: parameters)
13
+ end
14
+
15
+ def update_keywords(ad_account_id:, parameters: {})
16
+ @client.patch(path: "/ad_accounts/#{ad_account_id}/keywords", parameters: parameters)
17
+ end
18
+
19
+ def get_country_keyword_metrics(ad_account_id:, parameters: {})
20
+ @client.get(path: "/ad_accounts/#{ad_account_id}/keywords", parameters: parameters)
21
+ end
22
+
23
+ # Region list: "US" "CA" "DE" "FR" "ES" "IT" "DE+AT+CH" "GB+IE" "IT+ES+PT+GR+MT" "PL+RO+HU+SK+CZ" "SE+DK+FI+NO" "NL+BE+LU" "AR" "BR" "CO" "MX" "MX+AR+CO+CL" "AU+NZ"
24
+ # trend_type: "growing" "monthly" "yearly" "seasonal"
25
+ # https://developer.pinterest.com/docs/api/v5/#operation/trending_keywords/list
26
+ def list_trending_keywords(region:, trend_type:, parameters: {})
27
+ @client.get(path: "/trends/keywords/#{region}/top/#{trend_type}", parameters: parameters)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,16 @@
1
+ module Pinterest
2
+ class Terms
3
+ def initialize(client: nil)
4
+ @client = client
5
+ end
6
+
7
+ # parameters: { terms: ["example", "of", "query"]}
8
+ def list_related_terms(parameters: {})
9
+ @client.get(path: "/terms/related", parameters: parameters)
10
+ end
11
+
12
+ def list_suggested_terms(parameters: {})
13
+ @client.get(path: "/terms/suggested", parameters: parameters)
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Pinterest
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/pinterest.rb CHANGED
@@ -3,8 +3,10 @@ require "faraday/multipart"
3
3
  require_relative "pinterest/http"
4
4
  require_relative "pinterest/client"
5
5
  require_relative "pinterest/boards"
6
+ require_relative "pinterest/keywords"
6
7
  require_relative "pinterest/oauth"
7
8
  require_relative "pinterest/pins"
9
+ require_relative "pinterest/terms"
8
10
  require_relative "pinterest/version"
9
11
 
10
12
  module Pinterest
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pinterest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Lee
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-03 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1'
41
- description:
41
+ description:
42
42
  email:
43
43
  - donaldlee50@gmail.com
44
44
  executables: []
@@ -60,8 +60,10 @@ files:
60
60
  - lib/pinterest/client.rb
61
61
  - lib/pinterest/compatibility.rb
62
62
  - lib/pinterest/http.rb
63
+ - lib/pinterest/keywords.rb
63
64
  - lib/pinterest/oauth.rb
64
65
  - lib/pinterest/pins.rb
66
+ - lib/pinterest/terms.rb
65
67
  - lib/pinterest/version.rb
66
68
  - lib/ruby/pinterest.rb
67
69
  - rails-pinterest.gemspec
@@ -73,7 +75,7 @@ metadata:
73
75
  homepage_uri: https://github.com/royalgiant/rails-pinterest
74
76
  source_code_uri: https://github.com/royalgiant/rails-pinterest
75
77
  changelog_uri: https://github.com/royalgiant/rails-pinterest/blob/main/CHANGELOG.md
76
- post_install_message:
78
+ post_install_message:
77
79
  rdoc_options: []
78
80
  require_paths:
79
81
  - lib
@@ -88,8 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
90
  - !ruby/object:Gem::Version
89
91
  version: '0'
90
92
  requirements: []
91
- rubygems_version: 3.2.3
92
- signing_key:
93
+ rubygems_version: 3.0.3.1
94
+ signing_key:
93
95
  specification_version: 4
94
96
  summary: Pinterest API + Ruby!
95
97
  test_files: []