---
# System prepended metadata

title: Untitled

---

```ruby
class API::Facebook
  def post_photo(img)
    api('feed/photos', { image_url: img.publish_url, caption: img.caption })
  end
  
  def post_video(video)
    api('feed/videos', { url: video.publish_url, caption: video.caption, cover: video.cover })
  end
  
  # ...   
  
  private
  
  def api(path, params)
    # ...
  rescue e
    context = Context.new(path, params)
    rescue_api_error(e, context)
  end
  
  def rescue_api_error(e, context)
    # ...
  end
end

class API::Vkontakte
end
```