twitter

package
v0.0.0-...-cf905ae Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 6 Imported by: 0

README

Overview

The Twitter plugin scrapes message text for Twitter URLs, then attempts to fetch the linked Tweet and post it to the channel, like so:

08:29:19 <user> https://twitter.com/simonpierce/status/1265829199115218945
08:29:21 <chatbot> Tweet from @simonpierce: Gentoo penguins like to exercise their growing chicks by makingthem run around the colony, squawking hysterically, if they want to get fed.  I'm not saying it'd be fun to try this with your own kids if you're stuck at home... but I'm not not saying that. https://t.co/2Y0wewRKDw

Setting up Twitter API credentials

  • Request Twitter development access here (Note: the approval process takes about a week)
  • Once your dev access is approved, create an App here
  • Visit the App's "Keys and Tokens" tab
  • Save the Consumer API Key and Consumer API key secret in a safe place (it is not necessary to generate Access token and Access token secret for this plugin)
  • Export the required environment variables into the shell in which your go-chat-bot process will run:
export TWITTER_CONSUMER_KEY="yourconsumerkeyhere" \
       TWITTER_CONSUMER_SECRET="yourconsumersecrethere"

Documentation

Overview

Package twitter provides a plugin that scrapes messages for Twitter links, then expands them into chat messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status struct {
	Name string `json:"tweet.author.name"`
	Text string `json:"tweet.text"`
}

Jump to

Keyboard shortcuts

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