Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
Yuri Schimke edited this page Jul 18, 2018 · 29 revisions

OkHttp Social Client

A curl like client based on OkHttp with tight integration for Mac OSX

$ uberprices buckingham palace

Uber ETA

  show(staticMap(loc, dest, route?.routes?.firstOrNull()?.geometry))

  val prices = query<UberPriceEstimates>("https://api.uber.com/v1.2/estimates/price?start_latitude=${loc.latitude}&start_longitude=${loc.longitude}&end_latitude=${dest.latitude}&end_longitude=${dest.longitude}")
  val times = query<UberTimeEstimates>("https://api.uber.com/v1.2/estimates/time?start_latitude=${loc.latitude}&start_longitude=${loc.longitude}&end_latitude=${dest.latitude}&end_longitude=${dest.longitude}")

  for (price in prices.prices) {
    val time = times.times.find { it.productId == price.productId }

    val timeEstimate = time?.estimate?.let { "${it / 60} min" } ?: "Unknown"
    println(price.localizedDisplayName.padEnd(15) + "\t" + timeEstimate.padEnd(15) + "\t" + price.estimate);
  }

Features

Installation

$ brew install yschimke/tap/okurl
$ okurl --authorize twitter
$ okurl https://api.twitter.com/1.1/statuses/home_timeline.json
$ twitterapi /1.1/statuses/home_timeline.json

Optional Dependencies

$ brew install corelocationcli
$ brew install jq

Requires Java 8 and Mac OSX

$ brew cask install java

See Running for command options

Development

$ brew install jq
$ git clone https://github.com/yschimke/okurl
$ cd https://github.com/yschimke/okurl
$ . use_dev.sh
$ okurl --authorize twitter
$ okurl https://api.twitter.com/1.1/statuses/user_timeline.json

Dependencies

Clone this wiki locally