Bateman
Bateman knows cards. Use Bateman to fetch Twitter Card data from any URL. Bateman::TwitterCard
will fall back to Open Graph or basic HTML defaults if Twitter data is missing.
Installation
Add this line to your application's Gemfile:
gem 'bateman'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bateman
Usage
Pull the Twitter Card data (if available) from a URL:
Bateman::TwitterCard.new("http://example.com/articles/1")
Bateman::TwitterCard
has the following attributes available:
#card
#creator
#description
#image
#site
#title
#url
Dependencies
Ruby 1.9 is required.
Bateman uses HTTParty and Nokogiri to pull HTTP and process HTML data.
Credits
Sydney was created and is maintained by Geoff Harcourt at Five Tool Development.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request