Git Product home page Git Product logo

Uploadcare Ruby Gem

Simple ruby gem to interact with the Uploadcare API

Example Usage

require 'uploadcare'
pubkey = "d1531fba1b7fd176feaec8d1e7d86650ac549b9644e9279197a8c901243509dc"
pvtkey = "2f769cf086ece700f69fc58fb61e64a7708fee777068dc3f75798ae6166891f1"
file_id = "b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu"
ucare = Uploadcare.new(pubkey, pvtkey)
file = ucare.file(file_id)
file.info # Returns the files info hash
file.keep # Returns the updated info hash

Example Info Hashes

Preclaim Hash:

{
	"upload_date"=>"2011-10-25 02:05:50",
	"last_keep_claim"=>nil,
	"on_s3"=>true,
	"url"=>"http://api.uploadcare.com/api/files/b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu/",
	"file_id"=>"b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu",
	"original_filename"=>"test-image.png",
	"original_file_url"=>nil
}

Postclaim Hash:

{
	"upload_date"=>"2011-10-25 02:05:50",
	"last_keep_claim"=>"2011-10-25 02:19:06",
	"on_s3"=>true,
	"url"=>"http://api.uploadcare.com/api/files/b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu/",
	"file_id"=>"b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu",
	"original_filename"=>"test-image.png",
	"original_file_url"=>"http://s3.amazonaws.com/uploadcare/b6nn9f2d-1aj2-6q87-ofk0-265d8nki0diu/testimage.png"
}

Notes

All data in the examples (pubkey, pvtkey, file_id, example hashses) are intended to show usage and format. These values are randomly generated strings for this example and are therefore not valid. You must use your own public and private key, as well as a valid file id. Since the API is still very limited, thats about the extent of what you can do. Once delete functionallity is added to the API I will update the gem

Uploadcare's Projects

blocks icon blocks

Stack-agnostic library for uploading, processing, and editing images on-the-fly

blocks-examples icon blocks-examples

The set of examples and code references of Uploadcare blocks integration

django-csp-reports icon django-csp-reports

Django app for handling browser reports from Content Security Policy violations

django-defender icon django-defender

A simple super fast django reusable app that blocks people from brute forcing login attempts

django-user-sessions icon django-user-sessions

Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions.

drifter icon drifter

Check for drift between Terraform definitions and deployed state.

heif-image-plugin icon heif-image-plugin

Simple HEIF (.heic and .avif) images plugin for Pillow base on pyhief library.

image-fns icon image-fns

Toolset for manipulating images in a browser

intercom-rank icon intercom-rank

Intercom Rank adds the actual domain rank, language and a site description from Alexa for any lead in your Intercom dashboard.

kombu icon kombu

Messaging library for Python.

libheif icon libheif

libheif is an HEIF and AVIF file format decoder and encoder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.