') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - rkdarst/MeetBot: IRC meetings management plugin for supybot (Python). · GitHub
Skip to content

Latest commit

History

207 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ABOUT
~~~~~
http://wiki.debian.org/MeetBot
Inspired by the original MeetBot, by Holger Levsen, which was itself a
derivative of Mootbot (https://wiki.ubuntu.com/ScribesTeam/MootBot),
by the Ubuntu Scribes team.
The Supybot file GETTING_STARTED
(/usr/share/doc/supybot/GETTING_STARTED.gz on Debian systems) provides
hinformation on configuring supybot the first time, including taking
ownership the first time. You really need to read this if you haven't
used supybot before.
INSTALLATION
~~~~~~~~~~~~
Requirements
------------
* pygments (optional) (debian package python-pygments) (for pretty IRC
logs). This package is no longer required (after HTMLlog2 became
default)
Install Supybot
---------------
* You need to install supybot yourself. You can use supybot-wizard to
make a bot configuration.
* See the file GETTING_STARTED
(/usr/share/doc/supybot/GETTING_STARTED.gz on a Debian system).
This tells all about supybot installation, and is an important
prerequisite to understanding MeetBot configuration.
* Don't use a prefix character. (disable this:
supybot.reply.whenAddressedBy.chars: in the config file - leave it blank afterwards.) If you do use a
prefix character, it should be different than the "#" MeetBot
prefix character. There are issues here which still need to be
worked out.
Install the MeetBot plugin
--------------------------
* Move the MeetBot directory into your ``plugins`` directory of
Supybot.
* You need the ``ircmeeting`` directory to be importable as a python
module.
* Easy method: Copy ``ircmeeting`` into the ``MeetBot`` directory.
This makes ``ircmeeting`` work as a relative import. However,
this will probably stop working with some future Python version.
* Other method: Copy ``ircmeeting`` somewhere into $PYTHONPATH.
* Make sure the plugin is loaded. Use the command ``load MeetBot``.
You can check the command ``config plugins`` to check what is
loaded.
Configuration
-------------
* Make supybot join any channels you are interested in. The wizard
handles this the first time around. After that, I guess you have to
learn about supybot. If the plugin is loaded, it is active on ALL
channels the bot is on. You can also command the bot after it's
online.
* Make a `meetingLocalConfig.py` file and put it somewhere that it can
be found:
- in $PYTHONPATH
- in the ircmeeting/ directory
- in the current working directory
* Configuration of meetingLocalConfig.py is covered in the manual,
doc/Manual.txt
Supybot does a lot, far more than this one readme can talk about. You
need to learn about supybot a bit, too, in order to be able to use
MeetBot properly.
DESIGN DECISIONS
~~~~~~~~~~~~~~~~
The MeetBot plugin doesn't operate like a regular supybot plugin. It
bypasses the normal command system. Instead it listens for all lines
(it has to log them all anyway) and if it sees a command, it acts on it.
- Separation of meeting code and plugin code. This should make it
easy to port to other bots, and perhaps more importantly make it
easier to maintain, or rearrange, the structure within supybot.
- Not making users have to register and have capabilities added. The
original meetbot ran as a service to many channels not necessarily
connected to the original owner.
- Makes it easier to replay stored logs. I don't have to duplicate the
supybot command parsing logic, such as detecting the bot nick and
running the proper command. Also, there might be command overlaps
with some preexisting plugins.
LICENSE
~~~~~~~
The MeetBot plugin is under the same license as supybot is, a 3-clause
BSD. The license is documented in each code file (and also applies to
this README file).

About

IRC meetings management plugin for supybot (Python).

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages