User Tools

Site Tools


melanobot:modules:web

Web Module

This module provide utilities to retrieve web resources. (Enabled by default)

Log Type

  • web – Logs web requests

HTTP Service

The web service activates automatically when the web module is enabled. It allows for the retrieval of web resources.

Config keys:

  • user_agent – Change the user agent string
  • redirects 3 – Maximum redirects to follow (0 = disable, -1 = infinite)

Abstract Handlers

SimpleWebApi

Inherits SimpleAction.

Provides a simple interface for derived handlers to aquire web resources asynchronously.

SimpleJson

Inherits SimpleWebApi.

Like SimpleWebApi, but it also parses the response as JSON.

Concrete Handlers

SearchVideoYoutube

Inherits SimpleJson.

Searches for a video on YouTube.

  • trigger video
  • yt_api_key – (REQUIRED) API key
  • reply https://www.youtube.com/watch?v=%videoIdFormatted String given on a successful search. Available expansions:
    • %videoID – Video ID
    • %title – Video title
    • %channelTitle – Channel name
    • %description – Short video description
  • not_found http://www.youtube.com/watch?v=oHg5SJYRHA0 – Reply to give when the search terms don't produce any result
  • order relevance – How the result is selected.Acceptable values are:
    • date – reverse chronological order
    • rating – from highest to lowest rating
    • relevance – relevance to the search query
    • title – sorted alphabetically
    • viewCount – from highest to lowest number of views

SearchImageGoogle

Inherits SimpleJson.

Searches images using Google.

  • trigger image
  • not_found Didn't find any image of %search – Simple string to return when the search terms don't produce any result. The following replacements are done on the string:
    • %search – The search terms
    • %user – Name of the user who triggered the search

UrbanDictionary

Inherits SimpleJson.

Search for a definition on Urban Dictionary

  • trigger define
  • not_found I don't know what %search means – Simple string to return when the search terms don't produce any result. The following replacements are done on the string:
    • %search – The search terms
    • %user – Name of the user who triggered the search

SearchWebSearx

Inherits SimpleJson.

Search the web using Searx

  • trigger search
  • url https://searx.me/ – Searx API URL
  • not_found Didn't find anything about %search – Simple string to return when the search terms don't produce any result. The following replacements are done on the string:
    • %search – The search terms
    • %user – Name of the user who triggered the search

VideoInfo

Inherits Handler.

Parses every chat message and if it finds a link to a video, it rends a reply with some information on the video.

It supports the following video-sharing websites:

  • YouTube (Note: It requires a YouTube Data API Key)
  • Vimeo
  • Dailymotion
  • yt_api_keyYouTube API key
  • reply Ha Ha! Nice vid %name! %title (#-b#%duration#-#)Formatted String supporting the following expansions:
    • %videoId – Video ID
    • %title – Video Title
    • %channelTitle – Name of the channel/author of the video
    • %description – Video Description
    • %duration – Video duration
    • %name – Name of the user who triggered the handler
    • %host – Host of the user who triggered the handler
    • %global_id – global_id of the user who triggered the handler
    • %channel – Channel of the message triggering the handler
melanobot/modules/web.txt · Last modified: 2015/06/07 14:31 by melanosuchus