Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geoffharcourt/bateman
A gem for fetching Twitter Cards from pages
https://github.com/geoffharcourt/bateman
Last synced: 4 days ago
JSON representation
A gem for fetching Twitter Cards from pages
- Host: GitHub
- URL: https://github.com/geoffharcourt/bateman
- Owner: geoffharcourt
- License: mit
- Created: 2013-01-23T15:11:46.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-25T21:43:39.000Z (almost 12 years ago)
- Last Synced: 2024-12-10T04:52:03.632Z (about 1 month ago)
- Language: Ruby
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bateman
[![Gem Version](https://badge.fury.io/rb/sydney.png)](http://badge.fury.io/rb/bateman)
[![Build Status](https://travis-ci.org/geoffharcourt/bateman.png?branch=master)](https://travis-ci.org/geoffharcourt/bateman)
[![Dependency Status](https://gemnasium.com/geoffharcourt/bateman.png)](https://gemnasium.com/geoffharcourt/bateman)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/geoffharcourt/bateman)Bateman [knows cards](http://www.youtube.com/watch?v=qoIvd3zzu4Y). Use Bateman to fetch [Twitter Card](https://dev.twitter.com/docs/cards) data from any URL. `Bateman::TwitterCard` will fall back to [Open Graph](http://ogp.me) 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](https://github.com/jnunemaker/httparty) and [Nokogiri](http://nokogiri.org) to pull HTTP and process HTML data.
## Credits
Sydney was created and is maintained by [Geoff Harcourt](http://github.com/geoffharcourt) at [Five Tool Development](http://fivetool.io).
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request