How to search wikipedia and get input or info in C++? - c++

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.

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

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...

Related

How does GDB pretty printer know the output format the user is requesting?

I have a few complex classes generated by a third party domain-specific tool. The classes are complex because the tool tries to be generic as much as possible, so that I was asked to design a GDB pretty printer python script to improve the debugging experience.
I designed it by "to_string" APIs which can print the information with organized rich text (e.g. colors), so far everything works fine.
However, I don't know how to get the output format user requests, no matter that user uses "p" or "p/x" will all output the same string because my script does not know user wants hex rather than decimal.
I tried googling but didn't figure out an elegant approach. I indeed have a few workarounds but they all change the usages (for example, implement two printers to be switched), please give me some suggestions, thank you.
Just realized there had been a feature request to GDB already.
Bug 17291 - IWBN if the print format was available to pretty-printers.

How to write to, edit, and retrieve specific cells from an Excel doc with C++?

Basically, I want to be to be able to pass data between Excel cells and
my C++ program. I don't have any experience in Excel/C++ interactions and I haven't been able to find a coherent explanation or documentation on any websites. If someone could link me some references or provide one themselves it would be much appreciated. Thanks.
If this is for a Windows system, you could always use one of the available managed Excel libraries, such as OfficeWriter or Aspose.
There also might be similar libraries specifically for c++, I know we (OfficeWriter) used to make one.
Edit: Looks like there are a few out there, like LibXL and BasicExcel.
If the application will run on an end user machine with Excel installed, you can easily use the Excel interop and keep Excel hidden.
In addition to LibXL and BasicExcel mentioned by smoore, there is:
ExcelFormat Library is an improved version of the BasicExcel library and will allow you to read and write simple values. It is free.
xlslib will also read and write simple values, I have not tried it tho. It is also free.
Number Duck, is a commercial library that I have written, It supports reading and writing values, formulas and pictures. The website has examples of how to use the features.

Is there a search engine for C++ commands?

I do C++ and R programming since last 3 years.
I wish to know is there a search engine for C++ commands where I can find all the details regarding the command.
This is the example of what I am looking for:
This is a search engine for R commands:
http://www.rseek.org/
Google works pretty well.
If you only want C++ hits, use the site: restriction, as in "site:cppreference.com emplace_back"
Perhaps "site:cppreference.com pow" is a better example, since pow by itself would normally come up with many unrelated hits.
Of course, keyword search works also, try "site:cppreference.com natural logarithm"
I use this often: http://www.cplusplus.com/. It has a search box.

Google Bot information?

Does anyone know any more details about google's web-crawler (aka GoogleBot)? I was curious about what it was written in (I've made a few crawlers myself and am about to make another) and if it parses images and such. I'm assuming it does somewhere along the line, b/c the images in images.google.com are all resized. It also wouldn't surprise me if it was all written in Python and if they used all their own libraries for most everything, including html/image/pdf parsing. Maybe they don't though. Maybe it's all written in C/C++. Thanks in advance-
you can find a bit about how googlebot works here:
http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=158587
for example the "fetch as googlebot" tool lets you see a page as Googlebot sees it.
The crawler is very likely written in C or C++, at least backrub's crawler was written in one of these.
Be aware that the crawler only takes a snapshot of the page, then stores it in a temporary database for later processing. The indexing and other attached algorithms will extract the data, for example the image references.
Officially allowed languages at Google, I think, are Python/C++/Java.
The bot likely uses all 3 for different tasks.

Apache mod_c++ wanted?

I want to experiment a bit with C++ as a server side language. I'm not looking for a framework, and simply want to achieve a silly old "Hello World" webapp using C++.
Is there an Apache HTTP server module that I can install?
If i can do the PHP equivalent of :
<?php
$personName = "Peter Pan";
echo "Hello " . $personName;
I'd be most thrilled! Thanks in advance!
cgi would do this. Just have your C++ app spit its output to stdout and your mod_cgi will handle it
You might want to have a look at http://www.webtoolkit.eu/wt or www.tntnet.org instead.
"mod_c++" doesn't make sense; Once you're talking about compiled programs, Apache doesn't care what language the binary comes from. mod_cgi allows Apache to invoke such a binary (regardless of it's source language) in response to HTTP requests. Read more here:
http://library.thinkquest.org/16728/content/cgi/cplusplus.html
Suppose for the moment the OP wanted something that was "like mod_php, mod_perl". Given the right configuration, it would be monumentally easy for the "mod_c++" to look at the source files, and compiled files and decide whether it had to do a "one off" compilation task. In fact this is how make works.
I know the OP probably didn't mean that it had to be "interpreted", but it's certainly not impossible to allow apache to compile cpp files on the fly if needed [this is how jsp works, btw].
I did create a mod_cpp once. It basically was written in c, but loaded a .so which was in turn written in C++.
Its performance was really good, but lacked a lot of things that we take for granted in things like PHP (sessions, HTML un/escaping, etc). It did use a template engine to separate the HTML from the C++.
I tell you, the initial set-up was a lot of work (the mod_cpp part); after that, it was kinda easy to write the .so's. I even tried to create an sf.net project to open-source it, but I never got around to actually porting it :-(
In summary: I did not find anything like that on the net, did it myself and found out to be a lot more work then I anticipated, but the result was very cool! This helped me a lot: Apache Modules
I'm not saying there is no such thing, but if there is it would be monumentally inefficient. C++ is a compiled language, not an interpretive one, so the putative Apache C++ module would have to invoke the C++ compiler to compile the code before executing it. This would be very, very slow, apart from other problems.