Giter VIP home page Giter VIP logo

slack-wikipedia's Introduction

Build Status

Wikipedia Slackbot

A Slack bot that fetches information from Wikipedia APIs. This is a work in progress, please beware running this in a public Slack workspace. More info will be added to the readme soon.

Running the bot

To run the bot locally:

  1. Clone the repo
  2. Get a bot token for your Slack token
  3. Add a local variable SLACK_TOKEN with the value of the token you created
  4. Run go run main.go

Bot commands

To see the list of available commands, mention the bot with help. Example: @wikibot help.

To respond to commands, the bot needs to either be in a channel it was directly invited into, or the command needs to be given in a private message to the bot user.

Credits and license

Created by Moriel Schottlender (mooeypoo) under MIT license.

Please report bugs and feature requests in the issues!

slack-wikipedia's People

Contributors

mooeypoo avatar

Stargazers

Eduardo Medina avatar Huei Tan avatar

Watchers

 avatar James Cloos avatar

slack-wikipedia's Issues

Try to handle case-sensitivity in Wikipedia titles

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.

Correct the conversion/check of UTC dates in 'top'

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.

Order search results by "rank"

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.