This is a bot account used by Mr. Starfleet Command. Please use the bot requests page to request bot edits. If you have questions about this bot or notice it making strange edits, please contact its operator.
This bot started out on another wiki using the MassEdit script from the Dev Wiki. By the time it was granted a bot flag on Memory Alpha, Botfleet had mostly transitioned to using bot.js, a custom JavaScript tool written and maintained by its operator, Mr. Starfleet Command. In December 2024, the Pywikibot software was set up for this bot and will likely be used alongside bot.js going forward, with MassEdit continuing to be used on occasion.
Task log
This bot uses regular expressions to search Memory Alpha and identify portions of text that need to be altered. For the purpose of reviewing and rerunning previous bot runs, I keep a record of some of the more complex or useful RegExp snippets. I have moved some RegExp that can be executed without much supervision to the bot's JSON file where it is executed in the background while making other edits.
| Find | Replace | Status | Notes |
|---|---|---|---|
| *\{\{[ _]*([Ii]ncite|[Pp]na-cite|[Nn]one[ _]+selected)[ _]*\}\} | {{$1|date=June 2026}} | Monthly | dating maintenance tags Category:Memory Alpha pages needing citation |
| \[\[[ _]*[cC][Aa][Tt][Ee][Gg][Oo][Rr][Yy][ _]*:[ _]*[mM]emory[ _]+Alpha[ _]+images[ _]+\(Humans\)[ _]*\]\] | [[Category:Memory Alpha images (Person's Name)]] | In progress | Image categories for individuals |
| (.)\s*\{\{[ _]*[Ss]poiler(?:[ _]+|[ _]*\|)(?:ABBR1|ABBR2|ETC)[ _]*\}\}\s*(.) | $1 $2 | Recurring | See: MA:SPOILER, MA:EXAMPLE, Category:Memory Alpha pages with spoilers |
| (?<!.)\s*\{\{[ _]*[Ss]poiler(?:[ _]+|[ _]*\|)(?:ABBR1|ABBR2|ETC)[ _]*\}\}\s*(.) | $1 | ||
| \b(January|February|March|April|May|June|July|August|September|October|November|December)(\|month\}\}|\]\])?(?: +|\n)of(?: +|\n)(\[\[|\{\{y\|)?(\d\d\d\d)\b([^\|]) | $1$2 $3$4$5 | Recurring | |
| \{\{[Tt]en Forward Thread Nav\|(.+)\}\} <!--.+-->$ | {{Ten Forward Thread Nav|$1|archived}} | Recurring | #1 |
| \{\{[Tt]en Forward Thread Nav\}\} <!--.+-->$ | {{Ten Forward Thread Nav||archived}} | Recurring | #2 |
| h(uman|umans|umanity)\b | H$1 | Recurring | For use in the main namespace |
| \[([Hh][Tt][Tt][Pp][Ss]?://[^[|\]<">=\s]+)\] | {{EL|$1}} | Recurring | #1 |
| \[([Hh][Tt][Tt][Pp][Ss]?://[^[|\]<">=\s]+) +([^\x5D\n|=]+)\] | {{EL|$1|$2}} | Recurring | #2 |
| [“”] | " | Recurring | Search titles for this so we don't break any links |
| [’‘] | ' | Recurring | Search titles for this so we don't break any links |
| (\d\d:\d\d, (?:January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d?\d, \d\d\d\d \((?:PST|EST|EDT|GMT|UTC|CET|CEST)\)|\d\d:\d\d, \d?\d (?:Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d\d\d \((?:PST|EST|EDT|GMT|UTC|CET|CEST)\)|\d\d:\d\d, \d?\d (?:January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d\d\d \((?:PST|EST|EDT|GMT|CET|CEST)\)|\d\d\d\d-\d\d-\d\dT\d\d:\d\d(?::\d\d)? \((?:PST|EST|EDT|GMT|UTC|CET|CEST)\)) | {{subst:#time:H:i, j F Y (T)|$1}} | Done | timestamp fix |
| (\d\d:\d\d), (\d\d\d\d) (January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d?\d) \((PST|EST|EDT|GMT|UTC|CET|CEST)\) | {{subst:#time:H:i, j F Y (T)|$1, $4 $3 $2 ($5)}} |
Images by individual
- Unmarked images of William T. Riker in Category:Memory Alpha images (Humans) (0)
- Unmarked images of William T. Riker not in Category:Memory Alpha images (Humans) (0)
- Images of William T. Riker without {{pictured}} or {{voiced}}
- File:Insulted by Maddox.jpg
- File:Large neural stimulator.jpg
- File:Lavelle and Riker at Ten Forward.jpg
- File:Lwaxana claims Riker.jpg
- File:Pulaski scans Riker's leg.jpg
- File:Rike being questioned by berel.jpg
- File:Riker alien swamp.jpg
- File:Riker and Brenna kiss.jpg
- File:Riker and La Forge look at the probe, remastered.jpg
- File:Riker and Troi discuss Data.jpg
- File:Riker destroys clone.jpg
- File:Riker experiences a schizophrenic episode.jpg
- File:Riker happy with progress.jpg
- File:Riker kills Yuta.jpg
- File:Riker meets Brenna.jpg
- File:Rikers argue.jpg
- File:Rikers face off.jpg
- File:Rikers imagined snakes.jpg
Ten Forward table
This table displays all open Ten Forward discussions. The date column is the date the page was created, the user column is the user who created it.
Backlog
- https://memory-alpha.fandom.com/api.php?action=query&list=iwbacklinks&iwblprefix= to check for uses of interwiki prefixes.
- Find and fix censored words
- Search for and fix all instances of
.\[\[File:Gral and Shran call a truce\.jpgin ns:3 - Find and fix all
channelanduseruses of {{youtube}} - Remove deprecated HTML syntax (
fonttag, etc.) - Replace old image links with <staff/> (http://images2.wikia.nocookie.net/__cb32675/wikia/images/e/e9/WikiaStaff.png)
- Special:Contributions/Roar v. Special:Contributions/W-Roar
- User:Archduk3/Edit, User:14bauhr/sandbox
- /\)(?:Tyrant|Jaf|...)\b/ in talk pages; also maybe / \(UTC\)\w+$/
- Fix instances of
<strike>tags
Pywikibot
To do
- Manual:Pywikibot/Scripts
- Manual:Pywikibot/Installation (for when I need to set it up again)
- Manual:Pywikibot and Manual:Pywikibot/Overview (probably won't need these)
- User:DataMA & User:Morn/cosmetic changes.py
Command lines
$ cd core # Navigate to folder
$ python3 pwb.py login # Login
$ git pull origin stable --recurse-submodules # Update Pywikibot
$ python3 pwb.py clean_sandbox -hours:12 -delay:15 # Sandbox cleanup
$ python3 pwb.py weblinkchecker -start:! # Log broken external links in /core/deadlinks/
$ python3 pwb.py weblinkchecker -repeat # Re-check broken external links
$ python3 pwb.py weblinkchecker -repeat -day:0 # Re-check all broken external links, even recent ones
$ python3 pwb.py interwiki -start:! # Add and correct interlanguage links
$ python3 pwb.py interwiki -continue # Continue fixing interlanguage links
$ python3 pwb.py interwiki -autonomous -start:! # Perform easy interlanguage link fixes, from the top
$ python3 pwb.py interwiki -autonomous -continue # Perform easy interlanguage link fixes, from where it left off
$ python3 pwb.py [global options] script_name [parameters] # General format
Modifications
# /core/scripts/clean_sandbox.py
content = {
'en': '{{sandbox}}',
}
pages = [pywikibot.page.BasePage(pywikibot.Site(), 'Sandbox', 4)]
# /core/scripts/weblinkchecker.py
ignorelist = [
# top-level domains:
re.compile(r'https?://(?:[^/]*\.)?test(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?example(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?invalid(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?localhost(/.*)?', flags=re.I),
# second-level domains:
re.compile(r'https?://[^/]*\*[^/]*(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?example\.com(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?example\.net(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?example\.org(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?berlinonline\.de(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?web\.archive\.org(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?cygnus-x1\.net(/.*)?', flags=re.I),
re.compile(r'https?://(?:[^/]*\.)?imdb\.com(/.*)?', flags=re.I),
# tel URI scheme
re.compile(r'tel:[\d-]+', flags=re.I),
]
return get_closest_memento_url(
url, timegate_uri='https://web.archive.org/web/')
# Remove links generated by {{bl}}
bracketted_link_regex = textlib.compileLinkR(False, True)
original_link_txt = (r'<sup'
r' class="original-link noicon"'
r' title="Original link">'
r'\[.+? \(X\)\]'
r'</sup>')
original_link_regex = re.compile(original_link_txt)
while original_link_regex.search(text):
text = original_link_regex.sub('', text)
def treat_page(self) -> None:
"""Process one page."""
page = self.current_page
expanded_text = page.expand_text()
for url in weblinks_from_text(expanded_text):
for ignore_regex in ignorelist:
if ignore_regex.match(url):
break
else:
# Each thread will check one page, then die.
thread = LinkCheckThread(page, url, self.history,
self.http_ignores, self.day)
# thread dies when program terminates
thread.daemon = True
# use hostname as thread.name
thread.name = removeprefix(
urlparse.urlparse(url).hostname, 'www.')
self.threads.append(thread)
# /core/pywikibot/tools/__init__.py
def __lt__(self, other):
"""Compare if self is less than other."""
if other is None:
return False
else:
return other > self._cmpkey()
# /core/pywikibot/page/_basepage.py
# if page_section not in headings:
# raise SectionError(f'{page_section!r} is not a valid section '
# f'of {self.title(with_section=False)}')