bouyguessms

package module
v0.0.0-...-b8c21c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 11 Imported by: 0

README

Bouygues SMS

Build Status GitHub release GitHub Release Date GoDoc

Send up to 5 free SMS per day using Bouygues Telecom unofficial API.
The program is released as a standalone binary and it can also be used as a GO library or as a Docker image.
The code is written in Golang.

CURRENT STATUS: BROKEN/NOT WORKING

I am not more using Bouygues Telecom as my telco provider and @cyosp reported that Bouygues may have changed something on their side.

Try it by yourself and a PR would be very much appreciated.

Usage

Using from the command line:

$ bouyguessms \
    -login "yourEmail@domain.com" \
    -pass  "yourPassword" \
    -to "0601010101,0602020202" \
    -msg "Hello World"
SMS sent successfully at 2017-10-12T07:10:39+02:00. SMS left: 4.

As a library in your GO program:

import "github.com/tomsquest/bouyguessms"

smsLeft, err := SendSms("yourEmail@domain.com", "yourPassword",
    "Hello Gophers, it's "+time.Now().String(),
    "0601010101")
if err != nil {
    log.Fatalln("error sending sms", err)
}
log.Printf("SMS sent. SMS left: %d.\n", smsLeft)

As a Docker image:

docker run -it --rm --read-only --init --security-opt="no-new-privileges:true" \
  tomsquest/bouyguessms \
  -login "yourEmail@domain.com" \
  -pass  "yourPassword" \
  -to "0601010101,0602020202" \
  -msg "Hello World"

Download/Release

Download binaries from the Release page.

Inspiration

Original code from Y3nd's bouygues-sms written in Javascript. Thanks!

Documentation

Index

Constants

View Source
const NoSmsLeft = SmsLeft(0)

NoSmsLeft represents an exceeded count of SMS

Variables

This section is empty.

Functions

This section is empty.

Types

type SmsLeft

type SmsLeft int

SmsLeft is the amount of remaining SMS

func GetSmsLeft

func GetSmsLeft(login, pass string) (SmsLeft, error)

GetSmsLeft fetches the remaining number of SMS

func SendSms

func SendSms(login, pass string, msg string, to string) (SmsLeft, error)

SendSms sends msg to the specified recipients

func (SmsLeft) IsExceeded

func (smsLeft SmsLeft) IsExceeded() bool

IsExceeded returns true when there is no remaining SMS

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL