Project

best_image

0.0
No commit activity in last 3 years
No release in over 3 years
Returns the *Best Image* found from a passed url
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 1.1.1
>= 1.5.2
 Project Readme

BestImage

This gem accepts a url and returns the best image found on that page. Best is determined by largest at this time, but in the future I would like to look for FaceBook meta tags that allow the publisher to set the best image.

Installation

Add this line to your application's Gemfile:

gem 'best_image'

And then execute:

$ bundle

Or install it yourself as:

$ gem install best_image

Usage

require 'best_image'

image_selector = BestImage::ImageSelector.new("http://www.path/to/page")

if image_selector.best_image   
  @best_image = image_selector.best_image   
else   
  # do defalut action in case network is down etc.   
  image_selector.errors   
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request