tags:

views:

304

answers:

3

I want my program to search wikipedia and get the info it searches for and put it into a large string and output into a file. How can I do that in C++? Any info please tell? need more anwsers please

+6  A: 

Use wget with the query URL

wget --output-document=result.html http://en.wikipedia.org/wiki/Special:Search?search=jon+skeet&go=Go

This searches for jon skeet and stores the result in result.html

To use it from C++ you can e.g. use the system() call to execute wget in a seperate process.

lothar
And, if you don't like that route, you can grab the free source code to wget to inform your own solution.
JasonTrue
umm can you get a source code or example and post somewhere and post on this website again please
H4cKL0rD
And now I know that Jon Skeet was a contributing author of "Groovy in Action". Interesting.
Michael Myers
what i meant was like example code a Whole one
H4cKL0rD
What, you mean make the community do the work for you? That's nasty ;-)
lothar
LOL sorry but a little bit ive been searching this on and off but nothing and i think yall can do it
H4cKL0rD
Now this is sounding more like a homework assignment, especially since you can't figure out how to browse the wget source repository.
JasonTrue
+1  A: 

There are a number of client APIs for MediaWiki (the wiki engine that powers Wikipedia). Here's a listing. They provide the ability to create/delete/edit/search articles. Nothing in straight C++ but it still may be useful.

DotNetWikiBot was quite useful on one project that I had...

Andrew Flanagan
For goodness sake... Why is this downvoted? Is it wrong?
Andrew Flanagan
+1 for crying. but only because i feel your pain.
Mark
I just hate downvotes for an answer without an explanation of why it's not helpful...
Andrew Flanagan
+4  A: 

libcURL is pretty popular. I don't know that the interface is especially object-oriented, but it's certainly usable from C++.

veefu