🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

preferredpictures

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preferredpictures

bundlerRubygems
Version
0.1.2
Version published
Maintainers
1
Created
Source

PreferredPictures Ruby Client Library

The PreferredPictures PHP library provides a convenient way to call the PreferredPictures API for applications written in Ruby

View the full documentation about the PreferredPicture's API

Learn more about what PreferredPictures can do.

Installation

gem install preferredpictures

And then execute:

$ bundle install

Or install it yourself as:

$ gem install preferredpictures

Usage

require "preferredpictures"

# Create a new client using an issued identity
# and a secret key
client = PreferredPictures::Client.new(
    identity: "testidentity",
    secret_key: "secret123456")

# A simple example with just choices and the a tournament.
url = client.createChooseUrl(
    choices: ['https://example.com/image-red.jpg',
              'https://example.com/image-green.jpg',
              'https://example.com/image-blue.jpg'],
    tournament: 'test-tournament')

# A more involved example setting a prefix and suffix
# applied to the choices for brevity
url = client.createChooseUrl(
    choices: ['red', 'green', 'blue'],
    tournament: 'test-tournament',
    choices_prefix: "https://example.com/image-",
    choices_suffix: ".jpg")

# The url returned will appear to be something like:
#
# https://api.preferred-pictures.com/choose-url?choices=red%2Cgreen%2Cblue&tournament=testing&expiration=[EXPIRATION]&uid=[UNIQUEID]&ttl=600&prefix=https%3A%2F%2Fexample.com%2Fjacket-&suffix=.jpg&identity=test-identity&signature=[SIGNATURE]
#
# which should be placed where it is needed in your application or templates.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/preferred-pictures/ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Preferredpictures project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 10 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts