Supposedly, anyway. Welcome!
supposedly / code-jam-1 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from python-discord/code-jam-1
Our first code jam - March 2018
License: MIT License
This project forked from python-discord/code-jam-1
Our first code jam - March 2018
License: MIT License
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?
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?
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.