# Have a look at the API docs for # information on attributes.
# *** Usage ***
# Set API key Socialmod::Base.api_key = ‘foo’
# Schedule moderation v = Socialmod::Item::Video.new v.src = ‘example.com/test.flv’ v.custom_id = 3384 v.save
v2 = Socialmod::Item.new v2.src = ‘’ v2.save
v3 = Socialmod::Item::Text.new v3.data = “Foo bar” v3.save
# Find moderated items task :moderate => [:environment] do
Socialmod::Item.find_moderated.each do |mod|
vid = FooItem.find_by_custom_id(mod.custom_id) rescue next
vid.update_attribute(:passed_moderation, mod.passed?)
end
end
# Flag moderate item item = Socialmod::Item.find_by_custom_id(mod.custom_id) item.flag!
# Get stats for the last 30 days Socialmod::Dashboard.find #=> #<Socialmod::Dashboard:0x2543e5c @attributes=“pending”=>137, “passed”=>14>
# Create users (email must be unique) u = Socialmod::User.new u.first_name = ‘Foo’ u.last_name = ‘Bar’ u.email = ‘[email protected]’ u.save u.auth_key #=> 213ea1cda0fc274abf442faa1ebdb1324b64f0f6
# Respond to callback class SocialmodController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => :index
def index
callback = Socialmod::Callback.new(params)
unless callback.valid?
return head(403)
end
if callback.passed?
# do stuff
elsif callback.deferred?
# do stuff
elsif callback.failed?
# do stuff
end
head 200
end
end