Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby library for consuming Webfingers

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 redfinger.gemspec
README.rdoc

Redfinger

Redfinger is a simple Ruby library built to consume the Webfinger protocol. It's simple!

For more information about Webfinger, see:

Installation

Redfinger is a gem:

gem install redfinger

Usage

Just call it with an e-mail address of a domain that provides the Webfinger protocol:

require 'redfinger'

Redfinger.finger('youraccount@gmail.com')

From there, you have access to the links provided in the response as well as some shortcuts for common uses:

finger = Redfinger.finger('youraccount@gmail.com')
finger.open_id.first.to_s # => "http://www.google.com/profiles/youraccount"

Links are simple hash based objects that store the 'rel' URI (such as that for hCard, OpenID, etc.), the 'href' (the actual destination URI), and the content type if specified. Note you can also just use #to_s on a link to get the destination URI.

So how can you use Webfinger to your advantage? Let's take the example of hCard. If you install the `mofo` library you can do this:

require 'mofo'
require 'redfinger'

hcard_uri = Redfinger.finger('example@gmail.com').hcard.first.to_s
hcard = hCard.find(hcard_uri)
hcard.fn    # => "Example Guy"
hcard.title # => "Title guy gave himself on Google profile"

Note that the Webfinger protocol is still in its alpha/infancy and there will likely be many changes as time progresses. This library will do its best to stay up-to-date and current with these changes over time.

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2010 Intridea, Inc. and Michael Bleigh. See LICENSE for details.

Something went wrong with that request. Please try again.