<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).&nbsp;</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&amp;titles=U2&amp;prop=revisions&amp;rvprop=content&amp;rvsection=0">http://en.wikipedia.org/w/api.php?action=query&amp;pageids=52780&amp;prop=revisions&amp;rvprop=content&amp;rvsection=0&amp;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 &lt;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&amp;titles=U2&amp;prop=images">http://en.wikipedia.org/w/api.php?action=query&amp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); "><a href="http://en.wikipedia.org/w/api.php?action=query&amp;titles=U2&amp;prop=revisions&amp;rvprop=content&amp;rvsection=0">pageids=52780</a></span>&amp;prop=images</a><a href="http://en.wikipedia.org/w/api.php?action=query&amp;titles=U2&amp;prop=revisions&amp;rvprop=content&amp;rvsection=0">&amp;format=json</a></div><div><br></div><div>but this object that i receive&nbsp;contains&nbsp;all the images of the page without specify where this images are used.</div><div><br></div><div>how is possible to know&nbsp;exactly&nbsp;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>