lib_WikiSandbox

These handlers are designed to work with the mediawiki sandbox interface: - Special:ApiSandbox You should be able to explore the api, and copy the sandbox fragments from the web interface, and add them to a handler below in order to code simple rest calls that return arrays.

The Mediawiki Sandbox API uses the older rest interface that does not provide cors headers. However it does provide access to details about eh wikipedia page that are important - for instance: - mw_PageData

# Where

File: lib_WikiSandbox.livecodescript Path: libraries/lib_WikiSandbox.livecodescript Project: lcw_Wiki Script: stack "lib_WikiSandbox" Type: library license: GPLv3 name: lib_WikiSandbox version: 0.1

# Code

digraph "default_header" { layout = "dot" graph [ clusterrank="true" ]; subgraph "PF" { node []; n7 [label="sandbox_GetRevision" URL="PF+sandbox_GetRevision+of+stack+%27lib_WikiSandbox%27"]; n21 [label="sandbox_GetExtract" URL="PF+sandbox_GetExtract+of+stack+%27lib_WikiSandbox%27"]; } subgraph "C" { node [fillcolor="LightBlue", style="filled", color="Blue"]; n12 [label="mw_SetHeaders" URL="C+mw_SetHeaders+of+stack+%27lib_WikiSandbox%27"]; n17 [label="sandbox_DeconstructPageArray" URL="C+sandbox_DeconstructPageArray+of+stack+%27lib_WikiSandbox%27"]; n18 [label="sandbox_DeconstructSectionArray" URL="C+sandbox_DeconstructSectionArray+of+stack+%27lib_WikiSandbox%27"]; } subgraph "F" { node [fillcolor="GreenYellow", style="filled", color="Green4"]; n3 [label="sandbox_PageGeoData" URL="F+sandbox_PageGeoData+of+stack+%27lib_WikiSandbox%27"]; n2 [label="mw_ConstructSlug" URL="F+mw_ConstructSlug+of+stack+%27lib_WikiSandbox%27"]; n11 [label="sandbox_ConstructWikiTextFragment" URL="F+sandbox_ConstructWikiTextFragment+of+stack+%27lib_WikiSandbox%27"]; n16 [label="sandbox_FetchArray" URL="F+sandbox_FetchArray+of+stack+%27lib_WikiSandbox%27"]; n14 [label="sandbox_FetchSectionArray" URL="F+sandbox_FetchSectionArray+of+stack+%27lib_WikiSandbox%27"]; n10 [label="sandbox_PageImageData" URL="F+sandbox_PageImageData+of+stack+%27lib_WikiSandbox%27"]; n13 [label="sandbox_ConstructUrl" URL="F+sandbox_ConstructUrl+of+stack+%27lib_WikiSandbox%27"]; n6 [label="sandbox_WikiText" URL="F+sandbox_WikiText+of+stack+%27lib_WikiSandbox%27"]; n5 [label="json_ToArray" URL="F+json_ToArray+of+stack+%27lib_WikiSandbox%27"]; n4 [label="sandbox_FetchJSON" URL="F+sandbox_FetchJSON+of+stack+%27lib_WikiSandbox%27"]; n1 [label="sandbox_ConstructPageQueryFragment" URL="F+sandbox_ConstructPageQueryFragment+of+stack+%27lib_WikiSandbox%27"]; n9 [label="sandbox_ConstructPageHtmlFragment" URL="F+sandbox_ConstructPageHtmlFragment+of+stack+%27lib_WikiSandbox%27"]; n8 [label="sandbox_WikiTextData" URL="F+sandbox_WikiTextData+of+stack+%27lib_WikiSandbox%27"]; n19 [label="sandbox_PageHtmlData" URL="F+sandbox_PageHtmlData+of+stack+%27lib_WikiSandbox%27"]; n15 [label="sandbox_ConstructSectionFragment" URL="F+sandbox_ConstructSectionFragment+of+stack+%27lib_WikiSandbox%27"]; n20 [label="sandbox_PageHtml" URL="F+sandbox_PageHtml+of+stack+%27lib_WikiSandbox%27"]; n22 [label="sandbox_AddSectionFragment" URL="F+sandbox_AddSectionFragment+of+stack+%27lib_WikiSandbox%27"]; } subgraph cluster1 { label="stack \"lib_WikiSandbox\""; style=filled; color=grey60; fillcolor=grey60; n12; n3; n2; n11; n16; n17; n14; n10; n7; n13; n6; n5; n4; n1; n18; n9; n8; n19; n15; n20; n21; n22 } n3 -> n5; n3 -> n4; n16 -> n5; n16 -> n4; n14 -> n15; n14 -> n16; n10 -> n5; n10 -> n4; n6 -> n7; n6 -> n8; n4 -> n13; n4 -> n12; n1 -> n2; n8 -> n11; n8 -> n16; n19 -> n16; n19 -> n9; n20 -> n21; n20 -> n19; n22 -> n2; }

View source code over at github

# Todo Some thoughts on what to do...

# External Calls This library calls the following external handlers: There are no external calls. This is a standlaone script.

# Related Here are some related libraries and models:

# Depends The handlers in this library have dependencies within the following stacks:

As such the library requires the following projects:

# See also - Library, Models and Menus