Last active
March 25, 2017 08:03
-
-
Save yuryoparin/57752ad10021026523acc53a2c62d101 to your computer and use it in GitHub Desktop.
Получение списка адресных книг в ePochta SMS API v3 через bash однострочник
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
key='Публичный ключ'; | |
pr_key='Приватный ключ'; | |
action='getAddressbook'; echo -e "key=$key;version=3.0;action=$action" | \ | |
tr ';' '\n' | \ | |
sort -t'=' -k1 | \ | |
cut -f2 -d'=' | \ | |
paste -s -d';' - | \ | |
sed "s/;//g;s/$/$pr_key/" | \ | |
tr -d '\n' | \ | |
md5 | \ | |
xargs -I {} curl -s --url "https://api.atompark.com/sms/3.0/$action?key=$key&sum={}" | \ | |
jq '.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment