Skip to content

Commit

Permalink
Added README.md and argument checks for news.go
Browse files Browse the repository at this point in the history
  • Loading branch information
makinje16 committed Oct 25, 2018
1 parent baec2ce commit 2b40dd2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.idea/
*.exe
assets/
*.exe
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# **Overview**
This go service through the use of Twilio and NewsAPI will hit the NewsAPI endpoint for igns headlines and send them to your cellphone number along with a small description of the headline and a link to the article or video.

# **Setup**
For this program to work you need to export these things in your environment:

```
export TWILIO_API_KEY=[api-key]
export TWILIO_SID=[account-sid]
export TWILIO_NUMBER=[your twilio number]
export NEWS_API_KEY=[api-key]
```

Both your Twilio API key and account SID can be found on your twilio console

News API key can be found after signing up with https://newsapi.org/

# **Usage**
The contract for this program is as follows:

```
./news <number to send messages to>
```

Note: the number needs to have the country Dialing code as well.
So for the United States an example number would be
`+15555555555`
7 changes: 6 additions & 1 deletion news.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ type IgnResponse struct {
}

func main() {
setTimer()
if len(os.Args) == 2 {
setTimer()
} else {
print("Usage:\n")
print(" ./news <cellNumber>\n")
}
}

func setTimer() {
Expand Down

0 comments on commit 2b40dd2

Please sign in to comment.