XRD
- Homepage
- http://xrd.rubyforge.org/
- Author
- Bob Aman
- Copyright
- Copyright © 2010 Google, Inc.
- License
- Apache 2.0
Description
An XRD parser for Ruby.
Example Usage
require 'xrd'
xrd = XRD.fetch_and_parse(
'http://www.google.com/s2/webfinger/?q=acct%3Agooglebuzz%40gmail.com'
)
xrd.subject
# => #<Addressable::URI:0x80fb3864 URI:acct:[email protected]>
xrd.aliases
# => [#<Addressable::URI:0x80fb3224 URI:http://www.google.com/profiles/googlebuzz>]
xrd.links(:media_type => 'application/atom+xml')
# => [#<XRD::Link:0x80fbc11c URI:https://www.googleapis.com/buzz/v1/activities/111062888259659218284/@public>]
xrd.links(:rel => 'describedby')
# => [
# #<XRD::Link:0x80fbd224 URI:http://www.google.com/profiles/googlebuzz>,
# #<XRD::Link:0x80fbc914 URI:http://www.google.com/s2/webfinger/?q=acct%3Agooglebuzz%40gmail.com&fmt=foaf>
# ]
xrd.links(:rel => 'describedby', :media_type => 'text/html')
# => [#<XRD::Link:0x80fbd224 URI:http://www.google.com/profiles/googlebuzz>]
Install
- sudo gem install xrd