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
-
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.
JasonTrue : And, if you don't like that route, you can grab the free source code to wget to inform your own solution.H4cKL0rD : umm can you get a source code or example and post somewhere and post on this website again pleaseMichael Myers : And now I know that Jon Skeet was a contributing author of "Groovy in Action". Interesting.H4cKL0rD : what i meant was like example code a Whole onelothar : What, you mean make the community do the work for you? That's nasty ;-)H4cKL0rD : LOL sorry but a little bit ive been searching this on and off but nothing and i think yall can do itJasonTrue : Now this is sounding more like a homework assignment, especially since you can't figure out how to browse the wget source repository. -
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?Mark : +1 for crying. but only because i feel your pain.Andrew Flanagan : I just hate downvotes for an answer without an explanation of why it's not helpful... -
libcURL is pretty popular. I don't know that the interface is especially object-oriented, but it's certainly usable from C++.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.