Difference between revisions of "Wrecks:Main Page"

From Publication Station
Line 14: Line 14:
A few examples on how to get Wrechs content from the wiki.
A few examples on how to get Wrechs content from the wiki.


All the pages under the Wrechs namespace:
All the pages under the Wrechs namespace:  
http://publicationstation.wdka.hro.nl/wiki/api.php?format=json&action=query&list=allpages&apnamespace=200
http://publicationstation.wdka.hro.nl/wiki/api.php? - the address of the API + ?
format=json& - the format in which the information with appear: JSON
action=query& - the action asked from the API: query
list=allpages& - what to query: a list of all the pages
apnamespace=200 - from all pages get only namespace with Namespace id = 200, which is the Namespace Wrechs   
& - a division between the different statements.


The content of the page [[Wrechs:foo]]
The content of the page [[Wrechs:foo]]:
http://publicationstation.wdka.hro.nl/wiki/api.php?format=json&action=query&titles=Wrechs:foo&prop=revisions&rvprop=content
 
like the previous, but with
titles=Wrechs:foo& - title (of page) to query:  Wrechs:foo
prop=revisions&rvprop=content&  - from the property revisions get the the content (rvprop=content) of the most recent revision of
 
The content of the page on the Nyan cat from English wikipedia:
 
https://en.wikipedia.org/w/api.php?format=json&action=query&titles=Nyan_Cat&prop=revisions&rvprop=content
 
==Mediawiki API Resources==
* API Tutorial https://www.mediawiki.org/wiki/API:Tutorial
* API overview https://www.mediawiki.org/wiki/API:Main_page

Revision as of 15:17, 8 April 2015

Main Page for the Wrechs project.

To make the content from Wrechs independent from the rest of the Publication Station of the wiki, always use the namespace Wreck: on the pages you create for the project.

To create pages use the following syntax: [[Wreck:mypage]] which will translate onto [[Namespace:title of the page]], and result onto page (links), such as the following:

Wreck:foo

Wreck:mypage


Using the API

A few examples on how to get Wrechs content from the wiki.

All the pages under the Wrechs namespace: http://publicationstation.wdka.hro.nl/wiki/api.php?format=json&action=query&list=allpages&apnamespace=200

http://publicationstation.wdka.hro.nl/wiki/api.php? - the address of the API + ?
format=json& - the format in which the information with appear: JSON 
action=query& - the action asked from the API: query
list=allpages& - what to query: a list of all the pages 
apnamespace=200 - from all pages get only namespace with Namespace id = 200, which is the Namespace Wrechs    
& - a division between the different statements.

The content of the page Wrechs:foo: http://publicationstation.wdka.hro.nl/wiki/api.php?format=json&action=query&titles=Wrechs:foo&prop=revisions&rvprop=content

like the previous, but with

titles=Wrechs:foo& - title (of page) to query:  Wrechs:foo
prop=revisions&rvprop=content&  - from the property revisions get the the content (rvprop=content) of the most recent revision of 

The content of the page on the Nyan cat from English wikipedia:

https://en.wikipedia.org/w/api.php?format=json&action=query&titles=Nyan_Cat&prop=revisions&rvprop=content

Mediawiki API Resources