wonderfl

description:

Ruby wrapper for the wonderfl API

see also: wonderfl.net/apis

note:

Requires api key, get yours from your account page.

wonderfl.net/account/api_keys/create

if you are not registered then you can get account easily.

installation:

  gem install wonderfl

usage:

Create a wonderfl API client using your api_key as follows:

  client = Wonderfl::Client.new('your api_key')
    or
  client = Wonderfl::Client.new
  client.api_key = 'your api_key'

if you want to cache the response from APIs

  client = Wonderfl::Client.new('your api_key,
                                :cache_file => 'cache.db',
                                :expire => 60*10)

You can then use that client to retrieve information about user or posted codes as so:

  client.get_user('user_name')  #=> Wonderfl::User
  client.get_user_codes('user_name')  #=> Wonderfl::UserCodes (Wonderfl::Code collection)
  client.get_code('code_id')  #=> Wonderfl::Code
  client.get_code_forks('code_id')  #=> Wonderfl::CodeForks (Wonderfl::Code collection)

You can then get all the information required from that object. for example, takes code informations.

  code = client.get_code('m3d6')  #=> Wonderfl::Code
  code.compile_ok  #=> 1
  code.favorite_count  #=> 24
  code.forked_count  #=> 11
  code.license  #=> 'MIT'
  code.swf  #=> 'http://swf.wonderfl.net/swf/usercode/,,,.swf'
  code.thumbnail  #=> 'http://wonderfl.net/images/capture/,,,.jpg'
  code.title  #=> 'flash on 2010-08-15'
  ...

license:

(The MIT License)

Copyright © 2010 wellflat

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.