rails-pinterest 0.1.3 → 0.1.5

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
  SHA256:
3
- metadata.gz: c1fc96a443db45b6ac15f51c8152b6e87145b1c6dacb58d5b465b2d8a69f8b82
4
- data.tar.gz: 6ea256a6db07492035e6e622f4cb7e5617792ef3963ec7a1e452a9406a7279ef
3
+ metadata.gz: 4c6d521452d6399bed1ad6cb1e5a194142005b44b5c73b22c0588fa462027bb5
4
+ data.tar.gz: 76634ea625edae39d823886bec5c03a248ae043d84f2c5654aa294689dd924d0
5
5
  SHA512:
6
- metadata.gz: 12bad857ab4b1aec512620322dc720c0e04243537279cad50c5be6242208c2aa3a264ef0ac82cbd87892da2f5276a7d7993f501d0fdac397718e0a0a580653a8
7
- data.tar.gz: 8c3a3ac50db6366fa37df5d5aacff6d8e556aa6545bbb7350c650ceb7096efa8999869427c7798773b7022cb559183f230167490330d4c6422d473ea2f355db7
6
+ metadata.gz: d7467673e59a06b891b81de327d58116d359ce18bae56dfedceb7df9eb7c4d024920b18359bd6d32053d0c54af16cd050ce4fb4c3c8a75d38a53c56e962b2a76
7
+ data.tar.gz: d565e07cab14223a77419430f325650f1afeb9bfd3c815a8507e3fbafa706ee0483222ee447a2751802065fc68f63d6896dfc2e9c6783940c5653d4ec04c9213
data/CHANGELOG.md CHANGED
@@ -14,4 +14,10 @@
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
21
+
22
+ ## [0.1.5] - 2024-01-17
23
+ - Update terms 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.5)
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::Terms.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,17 @@
1
+ module Pinterest
2
+ class Terms
3
+ def initialize(client: nil)
4
+ @client = client
5
+ end
6
+
7
+ # ex: client.terms.list_related_terms(terms:"anime,soccer")
8
+ def list_related_terms(terms:, parameters: {})
9
+ @client.get(path: "/terms/related?terms=#{terms}", parameters: parameters)
10
+ end
11
+
12
+ # ex: client.terms.list_suggested_terms(term: "anime")
13
+ def list_suggested_terms(term:, parameters: {})
14
+ @client.get(path: "/terms/suggested?term=#{term}", parameters: parameters)
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Pinterest
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
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.5
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: []