Skip to content

Instantly share code, notes, and snippets.

@AstroSnail
Created February 7, 2021 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AstroSnail/357de624ec6d49590398a68f88b493da to your computer and use it in GitHub Desktop.
Save AstroSnail/357de624ec6d49590398a68f88b493da to your computer and use it in GitHub Desktop.
Lucky pone!
#! /usr/bin/env nix-shell
#! nix-shell -i sh --packages jq
apikey=REDACTED
message="You are today's lucky pone! https://gist.github.com/AstroSnail/357de624ec6d49590398a68f88b493da"
lucky=$(curl --no-progress-meter --header "Authorization: Api-Key ${apikey}" https://points.horse/api/v1/pones.json | jq '.pones[].slug' | shuf --head-count=1)
lucky=${lucky#\"}
lucky=${lucky%\"}
curl --no-progress-meter --header "Authorization: Api-Key ${apikey}" https://points.horse/api/v1/pones/me.json | jq "{ point: { count: .pone.giftable_points_count, message: \"${message}\" } }" | curl --no-progress-meter --header "Authorization: Api-Key ${apikey}" --header 'Content-Type: application/json' --data-binary @- "https://points.horse/api/v1/pones/${lucky}/points/give.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment