
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
The fork contains the Youtube api as a new sotrage for paperclip.
See the paperclip Readme file here https://github.com/thoughtbot/paperclip
ImageMagick must be installed and Paperclip must have access to it. To ensure
that it does, on your command line, run which convert
(one of the ImageMagick
utilities). This will give you the path where that utility is installed. For
example, it might return /usr/local/bin/convert
.
Then, in your environment config file, let Paperclip know to look there by adding that directory to its path.
In development mode, you might add this line to config/environments/development.rb)
:
Paperclip.options[:command_path] = "/usr/local/bin/"
as a gem: gem 'paperclip-youtube', :require => 'paperclip'
as a plugin:
ruby script/plugin install git://github.com/dr-click/paperclip.git
In your model:
class User < ActiveRecord::Base
YOUTUBE_CONFIG = {:login_name=>Your_Login_Name,
:login_password=>Your_Login_Password,
:youttube_username=>Your_Youtube_Username,
:developer_key=>Developer_Key}
has_attached_file :video,
:storage=>:youtube,
:youtube_options=>YOUTUBE_CONFIG,
:url=> ':youtube_url'
end
In your migrations:
class AddVideoColumnsToUser < ActiveRecord::Migration
def self.up
add_column :users, :video_file_name, :string
add_column :users, :video_content_type, :string
add_column :users, :video_file_size, :integer
add_column :users, :video_updated_at, :datetime
add_column :users, :youtube_id, :string
end
def self.down
remove_column :users, :video_file_name
remove_column :users, :video_content_type
remove_column :users, :video_file_size
remove_column :users, :video_updated_at
remove_column :users, :youtube_id
end
end
In your edit and new views:
<% form_for :user, @user, :url => user_path, :html => { :multipart => true } do |form| %>
<%= form.file_field :video %>
<% end %>
In your controller:
def create
@user = User.create( params[:user] )
end
In your show view, this will return the thumbnail image: <%= image_tag @user.video.url(:thumbnail) %>
And you can return the video url, to use in the object tag: <%= @user.video.url %>
The credits of the Youtube integration for Dr-Click :
FAQs
Unknown package
We found that paperclip-youtube demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.