7.
The tweet process
Raspberry read a twitter stream for #cloudconf2015 #pic
Raspberry upload the original picture to AWS S3
AWS Lambda resize the image and optimize it for the web
AWS Lambda tweet the picture to the final user
9. Read the Twitter Stream
import (
tw "github.com/wdalmut/twitterstream/async"
)
client := tw.NewClient(
config.ConsumerKey,
config.ConsumerSecret,
config.AccessToken,
config.AccessSecret,
)
client.TrackAndServe("cloudconf2015", func(tweet *twitterstream.Tweet) {
// Here the logic!
})
github.com/wdalmut/twitterstream/async
github.com/darkhelmet/twitterstream
10. Grab pictures using commands! (easy)
cmd := exec.Command(
"raspistill", // Command name
"a", "www.cloudconf.it #cloudconf2015", //Watermarks
"t", "500",
"vf", "hf", //Rotate
"w", "1024", "h", "768", //1024x768
"quality", "60", //60%
"o", "/tmp/pic.jpg") // Put in /tmp folder
err := cmd.Run()
You can also take pictures using OS Signals
12. Cross-Compiling (install GO for ARM)
Prepare your environment
$ cd $GOROOT/src
$ GOOS=linux GOARCH=arm ./make.bash noclean
Compile your source code
$ GOARM=6 GOARCH=arm GOOS=linux go build