google

package
v0.0.0-...-3ba3d46 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package google implements a Service which adds !commands for Google custom search engine. Initially this package just supports image search but could be expanded to provide other functionality provided by the Google custom search engine API - https://developers.google.com/custom-search/json-api/v1/overview

Index

Constants

View Source
const ServiceType = "google"

ServiceType of the Google service

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	types.DefaultService
	// The Google API key to use when making HTTP requests to Google.
	APIKey string `json:"api_key"`
	// The Google custom search engine ID
	Cx string `json:"cx"`
}

Service contains the Config fields for the Google service.

Example request:

  {
			"api_key": "AIzaSyA4FD39..."
			"cx": "ASdsaijwdfASD..."
  }

func (*Service) Commands

func (s *Service) Commands(client types.MatrixClient) []types.Command

Commands supported:

!google image some_search_query_without_quotes

Responds with a suitable image into the same room as the command.

Jump to

Keyboard shortcuts

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