User:Overandoutnerd/Scripts/articleSummary

From Wikipedia, the free encyclopedia

articleSummary is a client-side JavaScript userscript designed to generate concise summaries of Wikipedia articles using Google's Gemini large language model. The script integrates directly into Wikipedia article pages and allows users to generate an AI-produced summary on demand, without modifying Wikipedia content or requiring server-side infrastructure.

StatusStable
First releasedJanuary 15, 2026
UpdatedFebruary 7, 2026
    (34 days ago)
Quick facts Author, Status ...
articleSummary
AuthorUser:Overandoutnerd
StatusStable
First releasedJanuary 15, 2026
UpdatedFebruary 7, 2026
    (34 days ago)
BrowsersAll browsers
SourceUser:Overandoutnerd/Scripts/articleSummary.js
Close

The script operates entirely in the user's browser and communicates directly with the Google Gemini API. All configuration data, including the API key, is stored locally.

Features

  • On-demand AI-generated summaries of Wikipedia articles
  • Uses official Wikipedia API to retrieve article text
  • Automatic chunking of long articles to comply with API limits
  • Progressive summarization and final summary merging
  • Modern user interface with rounded styling and animated loading indicator
  • No external libraries or frameworks required
  • Fully client-side execution

Setup

Prerequisites

Before using articleSummary.js, the following are required:

  • A registered Wikipedia account
  • JavaScript enabled in the browser
  • A Google Gemini API key

The script runs entirely in the user's browser and does not require any browser extensions or userscript managers.

Obtaining a Google Gemini API Key

The script uses Google's Gemini API to generate article summaries. Each user must supply their own API key.

Steps to obtain an API key

  • Visit Google AI Studio
  • Sign in with a Google account.
  • Open the API Keys section from the dashboard.
  • Create a new API key.
  • Copy the generated key.

No billing information is required for basic usage at the time of writing, although usage limits and policies are determined by Google.

Adding the Script to common.js

Wikipedia allows registered users to run personal JavaScript by editing their user common.js page. Steps

  • Log in to Wikipedia.
  • Navigate to your personal common.js file.
  • Add the following code to your common.js file.
importScript('User:Overandoutnerd/Scripts/articleSummary.js');
  • Save the page.
  • Reload Wikipedia pages (bypass cache if necessary).

The script will now load automatically on Wikipedia pages while you are logged in.

First-Time Use

When the Generate AI Summary button is clicked for the first time:

  • The script will prompt the user to enter their Gemini API key.
  • The key is stored locally using localStorage in the browser.
  • The key is never sent to Wikipedia or shared with other users.

If the stored key is removed from localStorage, the prompt will appear again.

API Key Storage and Privacy

  • The API key is stored only in the user's browser.
  • The key is used solely to send requests directly to Google's Gemini API.
  • Wikipedia servers do not receive or store the API key.
  • All generated summaries remain local and are not saved or published.

Users are responsible for complying with Google's API usage limits and terms of service.

License and Disclaimer

This script is provided for personal and educational use. Generated summaries are not official Wikipedia content and should not be treated as authoritative sources.

Related Articles

Wikiwand AI