<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Hi guys,</div><div><br></div><div>I am writing a ruby application to retrieve the wikipedia data: the main description and the main image (the one on the box in the left side). </div><div>As parameter I have the cruid of the wiki page, so I call the wiki API to get the data, now start the problems:</div><div><br></div><div>- Main description:</div><div>I call the following link to retrieve the json object with the data of the main description</div><div><br></div><div><a href="http://en.wikipedia.org/w/api.php?action=query&titles=U2&prop=revisions&rvprop=content&rvsection=0">http://en.wikipedia.org/w/api.php?action=query&pageids=52780&prop=revisions&rvprop=content&rvsection=0&format=json</a></div><div>the object is well formed but the text is on wikipedia format.</div><div><br></div><div>How is possible to convert it into a plain text? (without {{ }}, [ ] and <ref>)</div><div>is it possible to get a text plain directly ?<br><br></div><div><br>- Main img (if present)</div><div>my second problem is to find the right image to show after a research</div><div><br></div><div>I have tried to fetch the main image of a wiki page using the following link:<br><a href="http://en.wikipedia.org/w/api.php?action=query&titles=U2&prop=images">http://en.wikipedia.org/w/api.php?action=query&<span class="Apple-style-span" style="color: rgb(0, 0, 0); "><a href="http://en.wikipedia.org/w/api.php?action=query&titles=U2&prop=revisions&rvprop=content&rvsection=0">pageids=52780</a></span>&prop=images</a><a href="http://en.wikipedia.org/w/api.php?action=query&titles=U2&prop=revisions&rvprop=content&rvsection=0">&format=json</a></div><div><br></div><div>but this object that i receive contains all the images of the page without specify where this images are used.</div><div><br></div><div>how is possible to know exactly the image used on the left box of the wiki page?</div><div><br></div><div>anyone can help me?</div><div><br></div><div><br></div><div><br></div><div>Kind regards</div><div>Marco</div><div><br></div></body></html>