Wikipedia summary

Lead extract of an English Wikipedia article.

  • Web
  • Since 0.2.0
  • addon
  • wikipedia
  • article
  • summary
  • text
  • web
  • data

Open in TuneToys

Wikipedia summary as the Patch draws it, at default values: inlets on the left, outlets on the right.

Wikipedia summary fetches the title, short description, lead extract and thumbnail of one English Wikipedia article. It needs no key.

What it does#

The node is generated from the wikipedia addon manifest. It requests GET https://en.wikipedia.org/api/rest_v1/page/summary/<title> and runs it like a Web request. response is JSON with fields such as title, description, extract (plain text) and thumbnail.

The article title comes from the title port when cabled, otherwise from the node's title field (spaces may be underscores). With trigger cabled each trigger asks; otherwise a new title asks; with no cable at all it asks once at start. An unknown article answers HTTP 404 on status and error.

A Toy using this node requires the network and the wikipedia addon, enabled in Settings → Addons. Wikipedia text is CC BY-SA 4.0: credit Wikipedia and share alike when you reuse it, and follow the Wikimedia API usage guidelines.

When to use it#

Use it to bring words into a piece: an extract read by a text widget, a description that sets the mood of an LLM chat prompt.

Ports#

PortDirectionSignalLanes
triggerInputData (trigger)1
titleInputData (string)1
responseOutputData (json)1
statusOutputData (integer)1
errorOutputData (string)1
doneOutputData (trigger)1

Parameters#

This node has no numeric parameters.

  • title: text.

The only setting is the title text field (up to 255 characters), used while the title port has no cable.

Tips#

See also#

Wikipedia search, Convert, Console log, Data cables.

Help patches

Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.

1. A composer in brief

beginner Teaches: data-cables

Wikipedia summary fetches the lead of an article; Convert picks the extract text.

Patch: Wikipedia summary response output connected to Convert value input. Convert value output connected to Console log value input.
Connections as text
  • Wikipedia summary response output connected to Convert value input
  • Convert value output connected to Console log value input
  • The title field names the article; cable a string into title to look up others.
  • extract is plain text; the response also has title, description and thumbnail.
Frame preview: A composer in briefFrame “A composer in brief” with 2 elements: text heading, text hint.A COMPOSER IN BRIEFNeeds the network and the Wikipedia addon enabled. Text from Wikipedia, CC BY-S…
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Wikipedia search Search English Wikipedia for matching pages.
  • Convert Convert a value to another datatype, optionally picking a field or formatting a string; failures go to error.
  • Console log Write each incoming value to the Console panel with a level and label, rate-limited.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close