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
2009-04-10 21:45:25
And, if you don't like that route, you can grab the free source code to wget to inform your own solution.
JasonTrue
2009-04-10 21:47:58
umm can you get a source code or example and post somewhere and post on this website again please
H4cKL0rD
2009-04-10 21:48:14
And now I know that Jon Skeet was a contributing author of "Groovy in Action". Interesting.
Michael Myers
2009-04-10 21:48:52
what i meant was like example code a Whole one
H4cKL0rD
2009-04-10 21:49:10
What, you mean make the community do the work for you? That's nasty ;-)
lothar
2009-04-10 21:51:36
LOL sorry but a little bit ive been searching this on and off but nothing and i think yall can do it
H4cKL0rD
2009-04-10 21:55:06
Now this is sounding more like a homework assignment, especially since you can't figure out how to browse the wget source repository.
JasonTrue
2009-04-10 22:55:00
+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
2009-04-10 21:58:43
I just hate downvotes for an answer without an explanation of why it's not helpful...
Andrew Flanagan
2009-04-11 01:14:50