Code Monkey home page Code Monkey logo

code-jam-1's Introduction

๐Ÿ“ You are here

Supposedly, anyway. Welcome!

code-jam-1's People

Contributors

gdude2002 avatar jb3 avatar supposedly avatar

Watchers

 avatar

code-jam-1's Issues

Implement random snek fetching

On human wikipedia, randomness can be reasonably achieved by visiting Special:RandomInCategory/<category name>. We'll have to check and see how this is usable from within the API. Presumably it'd deal with the hardcoded.categories thing I had to add.

-- unless there's, potentially, a better way than RandomInCategory for us to get a random snek?

Parse markdown better

One of the most-important parts of the info fetching is where Wikipedia's HTML-styled text is converted to a Markdown representation of itself, so that Discord can display everything properly. Only problem is that this is... hard.

I poked around github for a bit yesterday and found html2text, which is nice and works okay for some pages (see bot.get('black mamba')), but it screws up... a lot... on some others (see bot.get('pythonidae'), and that's not even the worst). Following it around with re.sub() and str.replace() doesn't sound like too Pythonic (nor logical) an endeavor.

The two ways around this I can think of, while still fulfilling the end goal ofc of converting HTML-encoded text markup to Discord-markdown-formatted text, are (1) finding a better Python markdown parser and (2) going full regex from start to end.

The second would work swimmingly once finally implemented, but (speaking from experience!) it'd be somewhat tricky to debug and get working and it might sap up a few precious hours of our work time.
The first would be wonderful, but I don't think it's likely. Haven't found anything myself yet, at least.

Thoughts? Maybe other methods of parsing?

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.