Sawyer
Secret User Agent of HTTP
Install / Use
/learn @lostisland/SawyerREADME
Sawyer
Sawyer is an experimental hypermedia agent for Ruby built on top of Faraday.
Installation
Add this line to your application's Gemfile:
gem 'sawyer'
And then execute:
bundle
Or install it yourself as:
gem install sawyer
Usage
require "sawyer"
# Create a Sawyer agent
agent = Sawyer::Agent.new("https://api.github.com",
links_parser: Sawyer::LinkParsers::Simple.new)
# Fetch the root of the API
root = agent.root.data
# Access a resource directly
contributors = agent.call(:get, "repos/lostisland/sawyer/contributors").data
# Load a hypermedia relation
top_contributor = contributors.first
followers = top_contributor.rels[:followers].get.data
For more information, check out the documentation.
Development
After checking out the repo, run script/test to bootstrap the project and run the tests.
You can also run script/console for an interactive prompt that will allow you to experiment.
To package the gem, run script/package. To release a new version, update the version number in lib/sawyer.rb, and then run script/release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Check out the contributing guide for more information on contributing.
License
The gem is available as open source under the terms of the MIT License.
Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
