mooeypoo / slack-wikipedia Goto Github PK
View Code? Open in Web Editor NEWA wikipedia slack bot
License: MIT License
A wikipedia slack bot
License: MIT License
Use an empty image instead: https://commons.wikimedia.org/wiki/File:Transparent_square.svg
The search action API returns the results with a "rank" property that dictates the order. This order isn't preserved in the actual object that's created, so the returned processed results should use the 'rank' to order themselves.
The wikipedia.go
piece can be split to its own module, allowing to fetch data from the APIs -- splitting it out would mean that we can also look into allowing this "bot" to operate in other interfaces, like:
I'm not 100% sure if it's possible to immediately recognize whether a request cam from within a thread in Slack API but it's worth checking into, to make the responses consistent.
The 'top' command fetches from the Wikimedia Analytics cluster, that works with UTC. As a result, asking for results for a certain date is only available if that day is "over" in UTC time (the calculations for 'top' seem to be bundled per day rather than rolling)
The problem starts with assuming a fetch for "today" (when asking for top
without date parameters). If today's date, in the bot's timezone, is a day after the current UTC date (for SF, for example, this is basically true after 5pm) then the response is that "no results are found" but that is because the assumption of "today" is wrong.
I tried to fix it up by having a method comparison checking if the requested date is before UTC, but it isn't working very well. This should be fixed more in-depth.
The Wikipedia API (REST and Action APIs) assume case sensitivity for titles. It automatically capitalizes the first character, but requires proper capitalization for the rest of the title.
As a result, for a page that exists: Edward Colston
edward Colston
works (first character is auto-capitalized)edward colston
does not work (changed to Edward colston which does not exist)This might make some sense inside Wikipedia since pages with different capitalizations are indeed different pages but it is making it very difficult for bot users to understand why requests are failing.
If a result list presented an entry "Edward Colston" and the user follows up with @wikibot summary edward colston
then getting a "page not found" is confusing.
This ticket is about attempting to find a valid way to resolve this issue.
When a page is requested (and potentially for search results?) add links to the page's talk page and history page.
This might be the result of adding the fallback get command... But a direct usage of "search" command only returns the first result rather than a list, as intended.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.