~srushe/indieweb-authorship

ref: bfb8f392ddb10a4ebcc785044f58443abe7e9901 indieweb-authorship/README.md -rw-r--r-- 1.8 KiB
bfb8f392 — Stephen Rushe Add initial README.md and CODE_OF_CONDUCT.md 3 years ago

#Indieweb::Authorship

Indieweb::Authorship is a Ruby gem for identifying the author of an IndieWeb post using the authorship algorithm.

#Installation

Add this line to your application's Gemfile:

gem 'indieweb-authorship'

And then execute:

$ bundle

Or install it yourself as:

$ gem install indieweb-authorship

#Usage

#From a URL

You can simply provide a URL and the page will be retrieved before authorship is determined.

author = Indieweb::Authorship.identify(url)

#With pre-downloaded html (from a URL)

It is also possible to provide the html directly, along with the URL, in cases where you already have the page.

author = Indieweb::Authorship.identify(url, html)

#Result

If an author is identified then the result will be a hash containing the fields name (for the name of the author), photo (with a url for a photo of the author), and url (with a url for the page of the author). Some of these may be nil, but all will still be provided. If no author can be identified then the result will simply be a nil.

#Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/srushe/indieweb-authorship.

#License

The gem is available as open source under the terms of the MIT License.

#Code of Conduct

Everyone interacting in the Indieweb::Authorship project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

#Credits

A number of the spec example files are from...