Introduction
Introduction Statistics Contact Development Disclaimer Help
import os
import sys
if 'page' not in os.environ['QUERY_STRING']:
with open('info') as f:
for line in f:
print("i{}\t".format(line.strip()))
print("0The source of this script\t/users/bej/wikisummary/wikis
sys.exit()
import requests
import textwrap
from itertools import chain
headers = {'User-Agent': 'Gopher Wiki Summarizer (by jelle@pingiun.
query = {split[0]: split[1] for split in [entry.split('=') for entr
r = requests.get('https://en.wikipedia.org/w/api.php?action=query&f
key = list(r.json()['query']['pages'].keys())[0]
paragraphs = r.json()['query']['pages'][key]['extract'].replace('==
formatted = [textwrap.wrap(paragraph, drop_whitespace=True) + ['']
print("\n".join(["i{}\t".format(line) for line in chain.from_iterab
if len(formatted) > 8:
print("iOutput was too long, full page can be found here\t")
print("h{}\tURL:https://en.wikipedia.org/wiki/{}".format(query[
You are viewing proxied material from sdf.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.