rails-pinterest 0.1.9 → 0.2.1

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: de21c67b169331db4e159f70fcc91368f49ff5943efce3028648626ed4cec444
4
- data.tar.gz: '092dce98edd2c07fed522b7f15f138fa1f5f2ae9112e03729b23ee175bd0d49e'
3
+ metadata.gz: e9f78f64caadc2017e90645bd141efe9aa1053ea157efa80174d890566f4f5a4
4
+ data.tar.gz: 8a16d8ea1a14706dfc569fee733723c0b4de3ddb8e14c95fa4ce00024c8bfd3a
5
5
  SHA512:
6
- metadata.gz: f7691dd8aab99b018044827af463299ff2f40cc410b7657a73bcbd33a2ba54134f8714b1e1333d0ba2438e4f8513aaeaccb5af410e1a84fffba43727b6694755
7
- data.tar.gz: 7b06745a60caecb08fc762f8f6715acfc5b8525a13102d376ac3317fedc9903629ca5edbbc305e67297e6cd10e4c9277822dbfb5fe2245f2117bc3510a4dbb6a
6
+ metadata.gz: fd57e8676ce39d383b1cc627798974d47d94621dce88c16c034f24d06d91c09b2f2fa46d5135a15538641597513891bf07a73def1fde0d05a8e4c2d98655f1b3
7
+ data.tar.gz: 5672905ef81bdd7812d8450970bc304d8ac98e55ca62707e9cb20e5b3850aac2744cd5fbe7cf7e05923f25b28fc6aa460d525ed931ecd80487c291bab779e37d
data/CHANGELOG.md CHANGED
@@ -32,4 +32,10 @@
32
32
  - Bump version for changes in ReadMe.
33
33
 
34
34
  ## [0.1.9] - 2024-02-24
35
- - Correct the parameters for keyword metrics, get_country_keyword_metrics
35
+ - Correct the parameters for keyword metrics, get_country_keyword_metrics
36
+
37
+ ## [0.2.0] - 2024-02-25
38
+ - Correct the query parameters for keyword trends
39
+
40
+ ## [0.2.1] - 2024-03-11
41
+ - Add Media to API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-pinterest (0.1.9)
4
+ rails-pinterest (0.2.1)
5
5
  faraday (>= 1)
6
6
  faraday-multipart (>= 1)
7
7
 
data/README.md CHANGED
@@ -245,7 +245,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
245
245
 
246
246
  ## Release
247
247
 
248
- Update the version number in `version.rb`, update `CHANGELOG.md`, run `bundle install` to update Gemfile.lock, delete previous `rails-pinterest-{number}.gem`, run `gem build rails-pinterest.gemspec`, and then run `sudo bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org) by `gem push rails-pinterest-{number}.gem`.
248
+ Update the version number in `version.rb`, update `CHANGELOG.md`, run `bundle install` to update Gemfile.lock, delete previous `rails-pinterest-{number}.gem`, run `gem build rails-pinterest.gemspec`, `commit` the changes,and then run `sudo bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org) by `gem push rails-pinterest-{number}.gem`.
249
249
 
250
250
  ## Contributing
251
251
 
@@ -42,5 +42,9 @@ module Pinterest
42
42
  def oauth
43
43
  @oauth ||= Pinterest::Oauth.new(client: self)
44
44
  end
45
+
46
+ def media
47
+ @media ||= Pinterest::Media.new(client: self)
48
+ end
45
49
  end
46
50
  end
@@ -22,9 +22,15 @@ module Pinterest
22
22
 
23
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
24
  # trend_type: "growing" "monthly" "yearly" "seasonal"
25
+ # interest: "animals" "architecture" "art" "beauty" "childrens_fashion" "design" "diy_and_crafts" "education" "electronics" "entertainment" "event_planning" "finance"
26
+ # "food_and_drinks" "gardening" "health" "home_decor" "mens_fashion" "parenting" "quotes" "sport" "travel" "vehicles" "wedding" "womens_fashion"
27
+ # genders: "female" "male" "unknown"
28
+ # ages: "18-24" "25-34" "35-44" "45-49" "50-54" "55-64" "65+"
29
+ # normalize_against_group (boolean): false (default)
30
+ # limit [1-50]
25
31
  # 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)
32
+ def list_trending_keywords(region:, trend_type:, interest:, gender:, ages:, normalize_against_group:, limit:, parameters: {})
33
+ @client.get(path: "/trends/keywords/#{region}/top/#{trend_type}?interest=#{interest}&gender=#{gender}&ages=#{ages}&normalize_against_group=#{normalize_against_group}&limit=#{limit}", parameters: parameters)
28
34
  end
29
35
  end
30
36
  end
@@ -0,0 +1,19 @@
1
+ module Pinterest
2
+ class Media
3
+ def initialize(client: nil)
4
+ @client = client
5
+ end
6
+
7
+ def list_media_uploads(bookmark:, page_size:, parameters: {})
8
+ @client.get(path: "/media", parameters: parameters)
9
+ end
10
+
11
+ def register_media_upload(parameters: {})
12
+ @client.json_post(path: "/media", parameters: parameters)
13
+ end
14
+
15
+ def get_media_upload_details(media_id:, parameters: {})
16
+ @client.get(path: "/media/#{media_id}", parameters: parameters)
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Pinterest
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/pinterest.rb CHANGED
@@ -4,6 +4,7 @@ require_relative "pinterest/http"
4
4
  require_relative "pinterest/client"
5
5
  require_relative "pinterest/boards"
6
6
  require_relative "pinterest/keywords"
7
+ require_relative "pinterest/media"
7
8
  require_relative "pinterest/oauth"
8
9
  require_relative "pinterest/pins"
9
10
  require_relative "pinterest/terms"
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.9
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-25 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -61,6 +61,7 @@ files:
61
61
  - lib/pinterest/compatibility.rb
62
62
  - lib/pinterest/http.rb
63
63
  - lib/pinterest/keywords.rb
64
+ - lib/pinterest/media.rb
64
65
  - lib/pinterest/oauth.rb
65
66
  - lib/pinterest/pins.rb
66
67
  - lib/pinterest/terms.rb