Skip to main content
Wikipedia Top Finder
====================

|Travis| |PyPI| |PyPI|

|PyPI| |PyPI| |PyPI|

Ever wish you could do an "I'm feeling lucky" search on Wikipedia right
from chat? Want to be able to pull up a wikipedia link right there in
the group and settle the debate once and for all? This module will
search the English langauge Wikipedia for the query you provide and
return the URL for the top matching page.

Usage
-----

This lego listens for ``!wtf`` at the beginning of a message and
processes everything after it as a query.

Example: ``!wtf python`` will return
https://en.wikipedia.org/wiki/Python

Installation
------------

``pip3 install legos.wtf``

This is a Lego designed for use with
`Legobot <https://github.com/bbriggs/Legobot>`__, so you'll get Legobot
along with this. To deploy it, import the package and add it to the
active legos like so:

.. code:: python

# This is the legobot stuff
from Legobot import Lego
# This is your lego
from legos.wtf import WikipediaTopFinder

# Legobot stuff here
lock = threading.Lock()
baseplate = Lego.start(None, lock)
baseplate_proxy = baseplate.proxy()

# Add your lego
baseplate_proxy.add_child(WikipediaTopFinder)

Tweaking
--------

While you can use this one as-is, you could also add a localized version
to your Legobot deployment by grabbing `wtf.py <legos/wtf.py>`__ and
deploying is as a local module. `Example of a Legobot instance with
local modules <https://github.com/voxpupuli/thevoxfox/>`__

Contributing
------------

As always, pull requests are welcome.

.. |Travis| image:: https://img.shields.io/travis/bbriggs/legos.wtf.svg
:target:
.. |PyPI| image:: https://img.shields.io/pypi/pyversions/legos.wtf.svg
:target:
.. |PyPI| image:: https://img.shields.io/pypi/v/legos.wtf.svg
:target:
.. |PyPI| image:: https://img.shields.io/pypi/wheel/legos.wtf.svg
:target:
.. |PyPI| image:: https://img.shields.io/pypi/l/legos.wtf.svg
:target:
.. |PyPI| image:: https://img.shields.io/pypi/status/legos.wtf.svg
:target:

Release files for legos.wtf 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for legos.wtf 0.1.3
File Size Uploaded
legos.wtf-0.1.3.tar.gz 2.9 kB Details

Release files / legos.wtf-0.1.3.tar.gz

Download URL legos.wtf-0.1.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aeae0000f2b969e3b4967aa6cbead9e122fbf3018cbe91dff1fbcee46f5ccf38
BLAKE2b-256 checksum
How to use checksums
9466a862c85934588c3214d3fe7e0264bca65b9ae7f8f3d8171f790983aaaaed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page