0

I'm embedding Wikipedia pages in my app, and I'd like to show the same simplified abstract that Google Earth shows. (It gives the first several paragraphs and a link to the full content, without any serious layout.)

I know about the printable=true option, but that's not what I'm looking for.

koops
  • 188
  • 1
  • 6

3 Answers3

5

You might want to consider using the API : you can grab a "text" version of any article. Afterwards, it is up to you to extract the summary.

Another option is just to request the page in raw format:

Raw (Wikitext) page processing: sending a action=raw or a action=raw&templates=expand GET request to index.php will give the unprocessed wikitext source code of a page.

E.g.

http://en.wikipedia.org/wiki/Main_Page?action=raw

Of course you'll need to do a bit a scraping. Going through the API might prove more efficient as you have better control of what you can pull from the database directly (wikitext if you wish).

jldupont
  • 93,734
  • 56
  • 203
  • 318
0

Did you look at the Wikipedia API? Mediawiki (and so Wikipedia) has a feature-rich and flexible API which is documented on http://www.mediawiki.org/wiki/API

Emre Yazici
  • 10,136
  • 6
  • 48
  • 55
0

Use the mediawiki API with action=query and prop=revisions to fetch a given revision , remove the wikitext ( images, infoboxes) and extract the content of the first sentence.

Pierre
  • 34,472
  • 31
  • 113
  • 192