-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
49 lines (37 loc) · 854 Bytes
/
main.go
File metadata and controls
49 lines (37 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"log"
"net/url"
"github.com/ChimeraCoder/anaconda"
"github.com/go-ini/ini"
)
var Config *ini.File
const (
consumerKey = "your key here"
consumerSecret = "your secret here"
accessToken = "your token here"
accessSecret = "your secret here"
macAddress = "mac address of the dash button here"
)
func main() {
// Define buttons and action function
DashMacs[macAddress] = Tweet
// Kick it off!
SnifferStart()
}
func NoAction() {
log.Println("No action on click.")
}
func Tweet() {
PostTweet("Testing now")
}
func PostTweet(tweet string) {
anaconda.SetConsumerKey(consumerKey)
anaconda.SetConsumerSecret(consumerSecret)
api := anaconda.NewTwitterApi(accessToken, accessSecret)
v := url.Values{}
_, err := api.PostTweet(tweet, v)
if err != nil {
log.Println("We have an error now ", err)
}
}