Is there possibly a way to get the content of a page without sidebars, ads, and things? (Example on another website - main page and content page). I'm making a game and I want to have the game read the username (via the Username template).
Iggyvolz 17:36, July 5, 2012 (UTC)
Then you can use a script to set things up:
userName = JSON.parse(
$.ajax({
url: wgServer + '/api.php',
data: { action: 'query', format: 'json', rvprop: 'content', title: 'Template:Username' },
async:false
})
.responseText
);
// do stuff with the variable
TK999 17:44, July 5, 2012 (UTC)
If you just need the plain html of a page, you can add ?action=render to the url eg. http://community.wikia.com/wiki/Admin_Forum:Get_contents_of_a_page_without_sidebars,_header,_etc?action=render User:Matthew2602/sig 01:28, July 13, 2012 (UTC)