All Projects β†’ unsplash β†’ Unsplash_rb

unsplash / Unsplash_rb

Licence: mit
πŸ’Ž Ruby wrapper for the Unsplash API.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Unsplash rb

Unsplash Js
πŸ€– A server-side JavaScript wrapper for the Unsplash API
Stars: ✭ 1,647 (+715.35%)
Mutual labels:  free, unsplash, images, photos, photography
go-unsplash
Go Client for the Unsplash API
Stars: ✭ 70 (-65.35%)
Mutual labels:  photos, photography, unsplash
Exiftool Vendored.js
Fast, cross-platform Node.js access to ExifTool
Stars: ✭ 200 (-0.99%)
Mutual labels:  images, photos, photography
Unsplash Php
πŸ‘» Official PHP wrapper for the Unsplash API
Stars: ✭ 332 (+64.36%)
Mutual labels:  unsplash, images, photos
Datasets
🎁 3,000,000+ Unsplash images made available for research and machine learning
Stars: ✭ 1,805 (+793.56%)
Mutual labels:  unsplash, images, photos
Splash Cli
A simple, command line tool to download Unsplash wallpapers. It’s not intended to be anything particularly fancy β€” it just works.
Stars: ✭ 432 (+113.86%)
Mutual labels:  unsplash, photos, photography
Papr
🌁 An Unsplash app for iOS
Stars: ✭ 1,025 (+407.43%)
Mutual labels:  photos, photography
Photo Blog
The Photo Blog Application based on Laravel 5 and Vue.js 2 + Prerender
Stars: ✭ 55 (-72.77%)
Mutual labels:  photos, photography
Androidunplash
An unofficial Unsplash API library for Android
Stars: ✭ 80 (-60.4%)
Mutual labels:  unsplash, photos
Hexo Album
add album&photos with Hexo blog
Stars: ✭ 85 (-57.92%)
Mutual labels:  photos, photography
Photo view
πŸ“Έ Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
Stars: ✭ 1,280 (+533.66%)
Mutual labels:  images, photos
Wallpapers
Wallpapers for Pop!_OS
Stars: ✭ 91 (-54.95%)
Mutual labels:  photos, photography
Photo Affix
πŸ“· Stitch your photos together vertically or horizontally easily!
Stars: ✭ 969 (+379.7%)
Mutual labels:  images, photos
Elodie
An EXIF-based photo assistant, organizer, manager and workflow automation tool.
Stars: ✭ 840 (+315.84%)
Mutual labels:  photos, photography
Photobrowser.forms
Full screen image viewer(Xamarin.Forms) that includes "pinch to zoom" and "swipe to dismiss" gestures.
Stars: ✭ 75 (-62.87%)
Mutual labels:  images, photos
Opensource Socialnetwork
Open Source Social Network (OSSN) is a social networking software written in PHP. It allows you to make a social networking website and helps your members build social relationships, with people who share similar professional or personal interests. It is available in 16 international languages.
Stars: ✭ 710 (+251.49%)
Mutual labels:  free, photos
React Grid Gallery
Justified image gallery component for React
Stars: ✭ 571 (+182.67%)
Mutual labels:  images, photos
Moul
The minimalist publishing tool for photographers
Stars: ✭ 113 (-44.06%)
Mutual labels:  photos, photography
Pynet Pytorch
Generating RGB photos from RAW image files with PyNET (PyTorch)
Stars: ✭ 169 (-16.34%)
Mutual labels:  photos, photography
Thumbsup
Generate static HTML photo / video galleries
Stars: ✭ 493 (+144.06%)
Mutual labels:  photos, photography

unsplash_rb

Build Status Coverage Status

A ruby client for the Unsplash API.

Installation

Add this line to your application's Gemfile:

gem 'unsplash'

And then execute:

$ bundle

Or install it yourself as:

$ gem install unsplash

Usage

Configuration

Before making requests, you must configure the gem with your application ID and secret. If you are using Rails, you can do this in an initializer.

Unsplash.configure do |config|
  config.application_access_key = "YOUR ACCESS KEY"
  config.application_secret = "YOUR APPLICATION SECRET"
  config.application_redirect_uri = "https://your-application.com/oauth/callback"
  config.utm_source = "alices_terrific_client_app"

  # optional:
  config.logger = MyCustomLogger.new
end

API Guidelines

All API applications must abide by the API Guidelines.

As part of the API guidelines, all API uses are required to use utm links when providing credit to photographers and Unsplash. Set the config.utm_source to your app's name to automatically append the utm source.

Public-scope actions

If you are only making public requests (i.e. nothing requiring a specific logged-in user, for example liking photos or accessing private user details), then you're ready to go!

Looking for details of a specific photo? Find it by ID:

photo = Unsplash::Photo.find("tAKXap853rY")

Want a bunch of pictures of cats? You're on the internet; of course you do.

search_results = Unsplash::Photo.search("cats")

For a complete list of available actions, see our documentation details.

User Authorization

For non-public actions, you'll have to get the user's permission to access their data. Direct them to the Unsplash authorization URL:

requested_scopes = ["public", "read_user", "something_else_you_are_asking_for"]
auth_url = Unsplash::Client.connection.authorization_url(requested_scopes)

Upon authorization, Unsplash will return to you an authentication code via your OAuth callback handler. With that you can generate an access token:

Unsplash::Client.connection.authorize!("the authentication code")

And that's it. The API actions will be available to you according to whichever permission scopes you requested and the user authorized.

Hotlinking

Hotlinking the Unsplash image files is required

Unlike most APIs, Unsplash requires for the image URLs returned by the API to be directly used or embedded in your applications (generally referred to as hotlinking). By using the CDN and embedding the photo URLs in your application, Unsplash can better track photo views and pass those stats on to the photographer, providing them with context for how popular their photo is and how it's being used.

Track Download

Do you want to trigger track download attribution on a photo ?

photo = Unsplash::Photo.find("tAKXap853rY")
photo.track_download

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

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

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].