Skip to content

Instantly share code, notes, and snippets.

@rilinweb
Created April 17, 2015 19:21
Show Gist options
  • Save rilinweb/55655d6156c4444cb934 to your computer and use it in GitHub Desktop.
Save rilinweb/55655d6156c4444cb934 to your computer and use it in GitHub Desktop.
Sending SMS from Linux using sms.ru
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
71231234567 First Person
71231234568 Second Person
71231234569 Third Person
#!/bin/sh
smsRuApiId="SMS.RU_API_ID"
contactsList=$(cat $HOME/scripts/contacts.csv)
textMessage=$(zenity --entry --title="Mesaage text" --text="Please enter text SMS message")
if [ -n "$textMessage" ]
then phoneNumber=$(zenity --list --title="Select recipient" --column="Phone Number" --column="Name" $contactsList)
if [ -n "$phoneNumber" ]
then curl -d "text=$textMessage" http://sms.ru/sms/send\?api_id=$smsRuApiId\&to=$phoneNumber
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment