Tatooine
A Ruby interface to SWAPI (the Star Wars API).
Install / Use
/learn @philnash/TatooineREADME
Tatooine
A Ruby interface to SWAPI (the Star Wars API).
Installation
Add this line to your application's Gemfile:
gem 'tatooine'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tatooine
Usage
There are 6 resources available: Planets, Starships, Vehicles, People, Films and Species. They all have a similar interface.
planets = Tatooine::Planet.list
Tatooine::Planet.count
# => 60
planets.length
# => 10 # resources are paginated
planets.concat Tatooine::Planet.next
planets.length
# => 20
tatooine = Tatooine::Planet.get(1)
tatooine.name
# => "Tatooine"
tatooine.residents
# => [<Tatooine::Person>, ...]
tatooine.residents.first.name
# => "Luke Skywalker" # Will make the request to get the resource
Schema
In SWAPI the objects are described by their schemas. Check the SWAPI documentation to find out more about each of the objects.
Contributing
- Fork it ( https://github.com/philnash/tatooine/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate 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
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
