pinterest-ruby

Pinterest API wrapper for Ruby.

View on GitHub

Introduction

Gem Version Dependency Status Build Status Coverage Status

A tiny JSON API framework for Ruby on Rails.

https://sw.cowtech.it/pinterest-ruby

Introduction

Pinterest API wrapper.

Usage

Basic authorization flow

require "pinterest"

# Create the client
client = Pinterest::Client.new(client_id: "ID", client_secret: "SECRET")

# Authorization
url = "https://localhost:3000" # The URL MUST be HTTPS and configured on Pinterest Apps console.

puts client.authorization_url(url) # Send the user to this URL.

# ...

# Start a webserver that will listen on the url above, it will get called with a authorization code in the query string.
query = request.params[:code]

token = client.fetch_access_token(query) # This token can be saved for later use (see below).
client.access_token = token

# Play with the API!
p client.me

Authenticated flow

require "pinterest"

# Fetch the token saved above
token = "TOKEN"

# Create the client
client = Pinterest::Client.new(access_token: token)

# Play with the API!
p client.me

API Documentation

The API documentation can be found here.

Contributing to pinterest-ruby

Copyright

Copyright (C) 2017 and above Shogun shogun@cowtech.it.

Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.

Your browser is obsolete. For the best browsing experience, update it for free by visiting BrowseHappy.
There is a shiny new version. Update now!
Made by a proud Italian!