Jump to content

Extract Data From Wikipedia via Api


DrFixit

Recommended Posts

I'm building a website with ever-changing data, and I figure using the data from Wikipedia would help update my site. However, after messing around with some stuff I created to pull this content I've run into some issues.

i used the banner field, i created a new field name jr_episodes and tried to pull the data from this https://en.wikipedia.org/w/api.php?action=parse&page=Khaani&prop=wikitext&format=json

the code i put in the banner code is  and i am trying to pull this marked data field http://prntscr.com/mrex2l

$data = file_get_contents('https://en.wikipedia.org/w/api.php?action=parse&page=['listing']&prop=wikitext&format=json);
$json = json_decode($data,true);
$data = $data['parse']['wikitext']['num_episodes'];
return $json['episodes2'];

but the page is break after saving the field. whats the thing i am missing or doing wrongly?

Link to comment
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...