Skip to content

Instantly share code, notes, and snippets.

@gauravs
Last active August 4, 2016 17:33
Show Gist options
  • Save gauravs/0b233b4961dc4bd619b8 to your computer and use it in GitHub Desktop.
Save gauravs/0b233b4961dc4bd619b8 to your computer and use it in GitHub Desktop.
#yaml #bash Pretty Print
alias yaml_pp='ruby -e "require \"json\"; require \"yaml\"; print JSON.parse(STDIN.read).to_yaml"'
@gauravs
Copy link
Author

gauravs commented Jan 27, 2016

curl -s https://api.getchute.com/v2 | yaml_pp

@gauravs
Copy link
Author

gauravs commented Jan 27, 2016


---
response:
  version: 2
  code: 200
  method: GET
  href: https://api.getchute.com/v2
data:
  end_points:
    albums:
    - title: Album Listing
      href: https://api.getchute.com/v2/albums
      method: GET
    - title: Album Details
      href: https://api.getchute.com/v2/albums/:id
      method: GET
    - title: Album Create
      href: https://api.getchute.com/v2/albums
      method: POST
      request: '{"name":"My Awesome Album","moderate_media":true,"moderate_comments":false}'
    - title: Album Update
      href: https://api.getchute.com/v2/albums/:id
      method: PUT
      request: '{"name":"My Awesome Album","moderate_media":true,"moderate_comments":false}'
    - title: Album Delete
      href: https://api.getchute.com/v2/albums/:id
      method: DELETE
    album_assets:
    - title: Album Assets
      href: https://api.getchute.com/v2/albums/:album_id/assets
      method: GET
    - title: Album Asset
      href: https://api.getchute.com/v2/albums/:album_id/assets/:asset_id
      method: GET
    - title: Album Assets Geo Search
      href: https://api.getchute.com/v2/albums/:album_id/assets/geo/:lat_lng/:radius
      method: GET
      request: "/v2/assets/geo/25.64,-100.38/10000 or /v2/albums/:album_id/assets/geo/25.64,-100.38/10000"
    - title: Import Album Assets
      href: https://api.getchute.com/v2/albums/:album_id/assets/import
      method: POST
    - title: Add Album Assets via Shortcut
      href: https://api.getchute.com/v2/albums/:album_id/assets/add
      method: POST
      request: '{"shortcuts":["shortcut1","shortcut2"]}'
    - title: Sort Album Assets
      href: https://api.getchute.com/v2/albums/:album_id/assets/sort
      method: POST
      request: '{"ids":[1,2,3]}'
    - title: Move Album Asset
      href: https://api.getchute.com/v2/albums/:album_id/assets/:asset_id/move/:target_album_id
      method: POST
    - title: Copy Album Asset
      href: https://api.getchute.com/v2/albums/:album_id/assets/:asset_id/copy/:target_album_id
      method: POST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment