← Back

ofxDuckDuckGo

github.com/tettou771/ofxDuckDuckGo · @tettou771
OF 0.11 Web/Networking

Addon for searching using the DuckDuckGo Instant Answer API.

2 0 Last commit 3y ago Created 3y ago

README

ofxDuckDuckGo



An openFrameworks addon for searching using the DuckDuckGo Instant Answer API.

Features



Dependencies



Installation



1. Clone or download this repository into your openFrameworks/addons directory. 2. Add the ofxDuckDuckGo addon to your openFrameworks project.

Usage



1. Include the addon header in your ofApp.h file:

#include "ofxDuckDuckGo.h"


2. Create an instance of the ofxDuckDuckGo class in your ofApp.h file:

ofxDuckDuckGo duckDuckGo;


3. Call the search method with your search query and a callback function:

duckDuckGo.search("search query", [&](const ofJson& result, ofxDuckDuckGo::ErrorCode errorCode) {
// Handle the search result and error code here
});


4. In the callback function, check the error code and handle the search results:

void ofApp::onSearchResult(const ofJson& result, ofxDuckDuckGo::ErrorCode errorCode) {
if (errorCode == ofxDuckDuckGo::Success) {
// Process the search results
} else {
ofLogError() << "Error: " << duckDuckGo.getErrorMessage(errorCode);
}
}


License



This project is released under the MIT License. See the included LICENSE file for more information.

Authors



This addon was primarily developed by the OpenAI Assistant with the help and guidance of tettou771.

Get this addon

HTTPS
SSH