User:Wakebrdkid/Wikicode
From Wikipedia, the free encyclopedia
This is an improvement to the original Wikicode project mixed with some ideas from Wikidata. The original Wikicode doesn't add much value as a random collection of code snippets because the search engines already do a good job of indexing snippets from blog posts, Stack Exchange, etc. Wikidata essentially associates a database table with each Wikipedia article, which greatly simplifies many synchronized updating scenarios across multiple articles and multiple language versions of the encylopedia. This project will associate a Mathematica module with each article. The inclusion criteria are that you can add any code to an article's module that can be used to enhance, generate, or verify content for the associated encyclopedia article. Using functionality from modules associated with other articles is encouraged. The goal is to collaboratively build toward more high-level and sophisticated functionality than we could accomplish alone or in pre-determined small groups. Wikipedia recently added a namespace for storing Lua modules. Those are server-side modules that generate markup text to be included in articles and templates. These modules are client-side and are unconstrained.
Get started by copying and pasting the code below! Once you've loaded the utilities you can use Contents and Load to start using the packages or Login and Create to start adding your own.
ToExpression@
StringCases[
Import["http://en.wikipedia.org/w/api.php?action=query&titles=User:\
Wakebrdkid/Wikicode&prop=revisions&rvprop=content&format=json",
"JSON"][[1, 2, 1, 2, 1, 2, 3, 2, 1, 1, 2]],
"<syntaxhighlight lang=\"objc\">" ~~ code__ ~~
"</syntaxhighlight>" -> code][[1]]