MetricRain

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

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 12 Imported by: 0

README

MetricRain

This bot converts Tweets containing rain measurements from inches to cm.

This bot responds to Tweets from @SummerhillRain and uses the handle @MetricMartin.

This code should be put into a Google Cloud Function. Set up a cron job to call the function's webhook every 15 minutes. On each run it will respond to any Tweets that it has not yet responded to, that contain a rain measurement.

Documentation

Index

Constants

View Source
const (
	HisScreenName = "SummerhillRain"
	MyScreenName  = "MetricMartin"

	TESTING = false

	TWITTER_CONSUMER_KEY        = "TWITTER_CONSUMER_KEY"
	TWITTER_CONSUMER_SECRET     = "TWITTER_CONSUMER_SECRET"
	TWITTER_ACCESS_TOKEN        = "TWITTER_ACCESS_TOKEN"
	TWITTER_ACCESS_TOKEN_SECRET = "TWITTER_ACCESS_TOKEN_SECRET"
	PROJECT_ID                  = "metric-rain-twitter-bot"
)

Variables

This section is empty.

Functions

func DeleteMyTweets

func DeleteMyTweets()

func GetTheirTweets

func GetTheirTweets(screenName string) ([]anaconda.Tweet, error)

func HandleRequest

func HandleRequest(w http.ResponseWriter, r *http.Request)

HandleRequest is called by Google Cloud Functions when a webhook is received

func PostATweet

func PostATweet(inReplyTo, text string) error

func PrettyPrint

func PrettyPrint(v interface{}) string

func PrintTheirTweets

func PrintTheirTweets(screenName string)

func RunAJob

func RunAJob() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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