Difference between revisions of "Sourcerer Implementation Notes"
From Geohashing
imported>Sourcerer m (→Planing Campaign) |
imported>Sourcerer m (→Implementation) |
||
Line 1: | Line 1: | ||
− | + | __NOTOC__{{SourcererImplementationNav}} | |
− | + | == Some Basic Tasks == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | ||
'''Help Page''' | '''Help Page''' | ||
Line 25: | Line 14: | ||
'''List twenty more of Consecutive geohash achievement''' | '''List twenty more of Consecutive geohash achievement''' | ||
: http://wiki.xkcd.com/wgh/api.php?action=query&list=categorymembers&cmtitle=Category:Consecutive_geohash_achievement&cmcontinue=page|323030392d30332d31362035322030|17773&cmlimit=20 | : http://wiki.xkcd.com/wgh/api.php?action=query&list=categorymembers&cmtitle=Category:Consecutive_geohash_achievement&cmcontinue=page|323030392d30332d31362035322030|17773&cmlimit=20 | ||
− | |||
− | |||
=== PHP Code - List first twenty of Consecutive geohash achievement - Command line application === | === PHP Code - List first twenty of Consecutive geohash achievement - Command line application === | ||
Line 49: | Line 36: | ||
$readable = json_decode($json, true); | $readable = json_decode($json, true); | ||
print_r($readable); | print_r($readable); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
?></nowiki> | ?></nowiki> | ||
[[Category:Implementations]] | [[Category:Implementations]] |
Revision as of 14:32, 17 February 2015
Using MediaWiki api.php
- Hello World!
- Return page titles for a specified category
- Return template contents from a wiki page
- Wiki built-in templates
Some Basic Tasks
Help Page
JSON Page Content Dump
List first twenty of Consecutive geohash achievement
List twenty more of Consecutive geohash achievement
PHP Code - List first twenty of Consecutive geohash achievement - Command line application
<?php $html = file_get_contents('http://wiki.xkcd.com/wgh/api.php?action=query&list=categorymembers&cmtitle=Category:Consecutive_geohash_achievement&cmlimit=20'); echo $html; ?>
PHP Code - As above but use JSON
<?php $json = file_get_contents('http://wiki.xkcd.com/wgh/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:Consecutive_geohash_achievement&cmlimit=20'); $readable = json_decode($json, true); print_r($readable); ?>
PHP Expedition as JSON
<?php $json = file_get_contents('http://wiki.xkcd.com/wgh/api.php?format=json&action=query&titles=2015-02-07_52_1&prop=revisions&rvprop=content'); $readable = json_decode($json, true); print_r($readable); ?>