PageRenderTime 234ms queryFilters 0ms Sphinxql 117ms app.CodeModel.GetByIds 81ms findMatchingLines 23ms GetByIds 104ms meta 0ms repositoryFilters 17ms languageFilters 0ms sourceFilters 0ms

1,211 results for 'api duckduckgo com' (234 ms)

Source

Language

Repository

README.md git://github.com/ajanicij/goduckgo.git | Markdown | 104 lines
1goduckgo [![Build Status](https://travis-ci.org/ajanicij/goduckgo.svg?branch=master)](https://travis-ci.org/ajanicij/goduckgo)[![GoDoc](https://godoc.org/github.com/ajanicij/goduckgo/goduckgo?status.png)](http://godoc.org/github.com/ajanicij/goduckgo/goduckgo)
2========
3
4Go package for DuckDuckGo Instant Answer API.
5
5
6[DuckDuckGo](http://duckduckgo.com) is a search engine that:
7
11
12The Instant Answer API is described [here](http://duckduckgo.com/api.html). For
13example, the URL for querying about New York City is
14
15[http://api.duckduckgo.com/?q=New+York+City&format=json&pretty=1](http://api.duckduckgo.com/?q=New+York+City&format=json&pretty=1)
16
42
43Command-line utility
44--------------------
search.py git://github.com/myano/jenni.git | Python | 230 lines
88    ## grab results from the API for the query
89    duck_api_results = duck_api(query)
90
106            output = '%s - %s' % (topic['Name'], topic['Topics'][0]['FirstURL'])
107            if 'duckduckgo.com' in output:
108                ## as a last resort, DuckDuckGo will provide links to the query on its site
114        ## let's try scraping the html page
115        uri = 'https://duckduckgo.com/html/?q=%s&kl=us-en&kp=-1' % web.urllib.quote(query)
116        page = proxy.get(uri)
119
120        bad_results = ['/y.js?', '//ad.ddg.gg/', '.msn.com/', 'r.search.yahoo.com/',]
121        m = r_duck.findall(page)
146    #query = web.urllib.quote(query)
147    uri = 'https://api.duckduckgo.com/?q=%s&format=json&no_html=1&no_redirect=1&kp=-1' % query
148    results = proxy.get(uri)
API.php git://github.com/duckduckgo/php5-duckduckgo.git | PHP | 163 lines
4 * @file DuckDuckGo/API.php
5 * This file provides the base class to interface with the DuckDuckGo API.
6 * It will also include any necessary classes.
8 * Simple example:
9 *     $api = new DuckDuckGo\API();
10 *     $info = $api->zeroClickQuery('Internet Relay Chat');
25    /**
26     * The API base URL. This defaults to api.duckduckgo.com.
27     */
58        $this->noDisambiguations = FALSE;
59        $this->baseURL = 'api.duckduckgo.com';
60    }
140    /**
141     * Perform a ZeroClickInfo query against the DuckDuckGo API.
142     * @param query     The term to query for.
ddg.go git://github.com/whee/ddg.git | Go | 222 lines
4
5// DuckDuckGo Zero-click API client. See https://duckduckgo.com/api.html
6// for information about the API.
114	// BaseURL specifies where to send API requests. If zero-value,
115	// "api.duckduckgo.com" is used.
116	BaseURL string
118
119// ZeroClick queries DuckDuckGo's zero-click API for the specified query
120// and returns the Response. This helper function uses a zero-value Client.
125
126// ZeroClick queries DuckDuckGo's zero-click API for the specified query
127// and returns the Response.
150	if c.BaseURL == "" {
151		c.BaseURL = "api.duckduckgo.com"
152	}
duckduckgo.cpp git://pkgs.fedoraproject.org/kdeplasma-addons | C++ | 170 lines
28
29DuckDuckGo::DuckDuckGo(QObject *parent, const QVariantList& args)
30    : Plasma::AbstractRunner(parent, args)
35
36    addSyntax(Plasma::RunnerSyntax(QLatin1String( "duckduckgo :q:" ), i18n("Lists the search entries matching the query, using DuckDuckGo search")));
37    addSyntax(Plasma::RunnerSyntax(QLatin1String( "wolfram :q:" ), i18n("Searches using Wolfram Alpha, powered by DuckDuckGo")));
43
44    KUrl url = KUrl("http://api.duckduckgo.com/?q=futurama+characters&format=json&pretty=1");
45       // "http://api.duckduckgo.com/?q=define+ostensibly&format=json&pretty=1");
51
52DuckDuckGo::~DuckDuckGo()
53{
106
107void DuckDuckGo::startDuckDuckGoJob(Plasma::RunnerContext *context)
108{
search.rb git://github.com/jsn/rbot.git | Ruby | 518 lines
6# Author:: Tom Gilbert (giblet) <tom@linuxbrit.co.uk>
7# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
8#
18GOOGLE_SEARCH = "http://www.google.com/search?oe=UTF-8&q="
19GOOGLE_WAP_SEARCH = "http://www.google.com/m/search?hl=en&q="
20GOOGLE_WAP_LINK = /"r">(?:<div[^>]*>)?<a href="([^"]+)"[^>]*>(.*?)<\/a>/im
25
26DDG_API_SEARCH = "http://api.duckduckgo.com/?format=xml&no_html=1&skip_disambig=1&no_redirect=0&q="
27
27
28WOLFRAM_API_SEARCH = "http://api.wolframalpha.com/v2/query?input=%{terms}&appid=%{key}&format=plaintext" +
29           "&scantimeout=3.0&podtimeout=4.0&formattimeout=8.0&parsetimeout=5.0" +
30           "&excludepodid=SeriesRepresentations:*"
31WOLFRAM_API_KEY = "4EU37Y-TX9WJG3JH3"
32
Links.pm https://github.com/8dx/duckduckgo-roboduck.git | Perl | 112 lines
6my %links = (
7    # duckduckgo.com/*.html / etc.
8    "goodie"    => "https://duckduckgo.com/goodies.html",
8    "goodie"    => "https://duckduckgo.com/goodies.html",
9    "bang"      => "https://duckduckgo.com/bang.html",
10    "newbang"   => "https://duckduckgo.com/newbang.html",
10    "newbang"   => "https://duckduckgo.com/newbang.html",
11    "about"     => "https://duckduckgo.com/about.html",
12    "setting"   => "https://duckduckgo.com/settings.html",
12    "setting"   => "https://duckduckgo.com/settings.html",
13    "param"     => "https://duckduckgo.com/params.html",
14    "privacy"   => "https://duckduckgo.com/privacy.html",
19    "searchbox" => "https://duckduckgo.com/search_box.html",
20    "api"       => "https://api.duckduckgo.com/",
21    "homepage"  => "https://duckduckgo.com/",
api.tx https://github.com/nrw/duckduckgo-publisher.git | Unknown | 248 lines
32<div style="margin-bottom:20px;"></div>
33This API does not include all of our links, however. That is, it is not a full search results API or a way to get DuckDuckGo results into your applications beyond our instant answers. Because of the way <a href="http://help.duckduckgo.com/customer/portal/articles/216399">we generate our search results</a>, we unfortunately do not have the rights to fully syndicate our results. For the same reason, we cannot allow framing our results without our branding. Please see <a href="http://help.duckduckgo.com/customer/portal/articles/775109">our partnerships page</a> for more info on guidelines and getting in touch with us.
34
35<div style="margin-bottom:20px;"></div>
36Our long-term goal is for <a href="https://duckduckgo.com/goodies/">all of our instant answers</a> to be available through this open API. Many of these instant answers are open source via our <a href="http://duckduckhack.com/">DuckDuckHack</a> platform. Using that platform, you can add your own APIs and data sources as well.
37
38<p style="margin-top: 20px;">
39Our instant answers come from a variety of sources, including <a href="http://wikipedia.org">Wikipedia</a>, <a href="http://wikia.com/">Wikia</a>, <a href="http://crunchbase.com">Crunchbase</a>, <a href="http://github.com">GitHub</a>, <a href="http://wikihow.com">WikiHow</a>, <a href="http://thefreedictionary.com">The Free Dictionary</a> &ndash; over 100 in total.
40
52To consume it yourself, you can use one of the language libraries listed below or simply add '&format=json' (or xml if you have a death wish) onto any query URL in the api subdomain, e.g.
53<br><a href="http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1">http://api.duckduckgo.com/?q=DuckDuckGo&format=json</a>  
54
187<span class="small">
188<li>You can consume this API via <a href="http://www.mashape.com/apis/DuckDuckGo%20Zero-click%20Info">Mashape</a>, which provides PHP, Ruby, Python, Objective-C and Java (including Android) libraries. To do so, <a href="http://www.mashape.com/account/request-alpha-invite?apiName=DuckDuckGo%20Zero-click%20Info">sign up</a> (use the code DUCKDUCK) and <a href="http://www.mashape.com/account/login?apiName=DuckDuckGo%20Zero-click%20Info">login</a>.
189<li><a href="http://search.cpan.org/perldoc?WWW::DuckDuckGo">Perl module</a> & <a href="http://search.cpan.org/perldoc?duckduckgo">command line app</a> by <a href="http://twitter.com/#!/raudssus">@raudssus</a>. 
UI.pm https://github.com/nospampleasemam/p5-app-duckduckgo-ui.git | Perl | 450 lines
182
183# Deep results API
184sub fill_deep {
201    my ($self, $call) = @_;
202    my $request = HTTP::Request->new(GET => "https://api.duckduckgo.com/$call");
203    POE::Kernel->post('ua', 'request', 'http_response', $request, 'fill_deep');
216    my ($self, $text) = @_;
217    my $request = HTTP::Request->new(GET => 'https://duckduckgo.com/ac/?type=list&q=' . uri_encode($text));
218    POE::Kernel->post('ua', 'request', 'http_response', $request, 'fill_ac');
438            {'https://duckduckgo.com/'         => '<bold>Homepage</bold>'},
439            {'https://duckduckgo.com/about'    => '<bold>About</bold>'},
440            {'https://duckduckgo.com/goodies/' => '<bold>Goodies</bold>'},
440            {'https://duckduckgo.com/goodies/' => '<bold>Goodies</bold>'},
441            {'https://duckduckgo.com/feedback' => '<bold>Feedback</bold>'},
442            {'https://duckduckgo.com/privacy'  => '<bold>Privacy</bold>'},
update.rake https://bitbucket.org/andey/bestofama.git | Ruby | 100 lines
26    #update Reddit users link and comment karma
27    require 'api/reddit.com'
28    link_karma = 0
36    end
37    @op.update_attributes(:link_karma => link_karma, :comment_karma => comment_karma)
38  end
51  task :upcoming => :environment do
52    google = 'http://www.google.com/calendar/feeds/amaverify@gmail.com/public/full?orderby=starttime&max-results=100&singleevents=true&sortorder=ascending&futureevents=true&alt=json'
53    http = Net::HTTP.new("www.google.com")
68  task :tag => :environment do
69    require 'api/duckduckgo.com'
70    @tag = Tag.where(:meaningless => nil, :description => nil).first
75
76        duckduckgo = DuckDuckGo.new
77        result = duckduckgo.search(@tag.name)
search.py https://github.com/myano/jenni.git | Python | 345 lines
196        output = duck_api_results['Results'][0]['FirstURL']
197    elif 'AbstractURL' in duck_api_results and min_size('AbstractURL', duck_api_results):
198        ## if there is no 'result', let's try AbstractURL
200        output = duck_api_results['AbstractURL']
201    elif 'RelatedTopics' in duck_api_results and min_size('RelatedTopics', duck_api_results):
202        ## if we still can't find a search result, let's grab a topic URL
206            output = '%s - %s' % (topic['Name'], topic['Topics'][0]['FirstURL'])
207            if 'duckduckgo.com' in output:
208                ## as a last resort, DuckDuckGo will provide links to the query on its site
214        ## let's try scraping the html page
215        uri = 'https://duckduckgo.com/html/?q=%s&kl=us-en&kp=-1' % web.urllib.quote(query)
216        page = web.get(uri)
238    query = web.urllib.quote(query)
239    uri = 'https://api.duckduckgo.com/?q=%s&format=json&no_html=1&no_redirect=1&kp=-1' % query
240    results = web.get(uri)
faq.md https://github.com/a-West/duckduckgo.git | Markdown | 71 lines
9
10* Improve results in areas you personally search and care about, e.g. [programming documentation](https://duckduckgo.com/?q=perl+split), [gaming](https://duckduckgo.com/?q=roll+3d12+%2B+4) or [entertainment](https://duckduckgo.com/?q=xkcd).
11* Increase usage of your own projects, e.g. data and [APIs](https://duckduckgo.com/?q=cost+of+living+nyc+philadelphia).
17
18If you don't code at all and you've ended up here, please go over to our [ideas companion site](http://ideas.duckduckhack.com/) where you can suggest and comment on plugin ideas such as identifying the best sites and data sources to draw from. Similarly, you can submit [issues about current plugins](https://github.com/duckduckgo/duckduckgo/issues?direction=desc&sort=created&state=open). Both of these activities are very valuable and will help direct community efforts.
19
33### Do you have any plugin ideas?
34Yup! We maintain [a growing list](http://ideas.duckduckhack.com/). There are also improvement ideas for [Goodies](https://github.com/duckduckgo/zeroclickinfo-goodies/issues), [Spice](https://github.com/duckduckgo/zeroclickinfo-spice/issues), [Fathead](https://github.com/duckduckgo/zeroclickinfo-fathead/issues) and [Longtail](https://github.com/duckduckgo/zeroclickinfo-longtail/issues).
35
44
45### Why isn't my plugin in the [DuckDuckGo Instant Answers API](https://api.duckduckgo.com)?
46If your plugin is spice or longtail, sometimes we can't expose it through the API for licensing reasons (e.g. the WolframAlpha plugin), but our
66### Can I get the instant answers through an API?
67Yes! Check out the [DuckDuckGo API](https://api.duckduckgo.com). Our goal is to make as many plugins as possible
68available through this interface. Fathead and goodie plugins are automatically syndicated through the API, and Spice and Longtail are selectively (due to licensing complications) mixed in.
faq.md https://github.com/DavidMascio/duckduckgo-documentation.git | Markdown | 163 lines
8
9- Improve results in areas you personally search and care about, e.g., [programming documentation](https://duckduckgo.com/?q=perl+split), [gaming](https://duckduckgo.com/?q=roll+3d12+%2B+4) or [entertainment](https://duckduckgo.com/?q=xkcd).
10- Increase usage of your own projects, e.g., data and [APIs](https://duckduckgo.com/?q=cost+of+living+nyc+philadelphia).
16
17If you don't code at all and you've ended up here, please go over to our [instant answers ideas forum](http://ideas.duckduckhack.com/) where you can suggest and comment on instant answer ideas. For instance, identifying the best sources to draw from is extremely important but not many developers know the best sources, which is where you come in! Similarly, you can submit [issues about current instant answers](https://github.com/duckduckgo/duckduckgo/issues?direction=desc&sort=created&state=open). Both of these activities are very valuable and will help direct community efforts.
18
29
30If you don't know Perl, that's OK! Some instant answer types ([Fathead](https://github.com/duckduckgo/duckduckgo-documentation/blob/master/duckduckhack/fathead/fathead_overview.md), [Longtail](https://github.com/duckduckgo/duckduckgo-documentation/blob/master/duckduckhack/longtail/longtail_overview.md)) don't require the use of Perl. Also, if you know PHP, Ruby, or Python you should be able to write a [Goodie](https://github.com/duckduckgo/duckduckgo-documentation/blob/master/duckduckhack/goodie/goodie_overview.md) in Perl pretty easily using [this awesome cheat sheet](http://hyperpolyglot.org/scripting).
31
33
34Yup! We maintain [a growing list](http://ideas.duckduckhack.com/). There are also improvement ideas for [Goodies](https://github.com/duckduckgo/zeroclickinfo-goodies/issues), [Spice](https://github.com/duckduckgo/zeroclickinfo-spice/issues), [Fathead](https://github.com/duckduckgo/zeroclickinfo-fathead/issues) and [Longtail](https://github.com/duckduckgo/zeroclickinfo-longtail/issues).
35
82
83Yes! Check out the [DuckDuckGo API](https://api.duckduckgo.com). Our goal is to make as many instant answers as possible
84available through this interface. Fathead and goodie instant answers are automatically syndicated through the API, and Spice and Longtail are selectively (due to licensing complications) mixed in.
calc.py git://github.com/myano/jenni.git | Python | 256 lines
5Copyright 2009-2013, yano (yanovich.net)
6Copyright 2008-2013, Sean B. Palmer (inamidst.com)
7Licensed under the Eiffel Forum License 2.
26r_tag = re.compile(r'<(?!!)[^>]+>')
27WAKEY_NOTFOUND = "Please sign up for WolframAlpha's API to use this function. http://products.wolframalpha.com/api/"
28
61    ## Attempt #1 (Google)
62    uri_base = 'https://www.google.com/search?gbv=1&q='
63    uri = uri_base + web.urllib.quote(temp_q)
104            #### Attempt #2 (DuckDuckGo's API)
105            ddg_uri = 'https://api.duckduckgo.com/?format=json&q='
106            ddg_uri += urllib.quote(q)
204
205    uri = 'https://api.wolframalpha.com/v2/query?reinterpret=true&appid=' + appid
206    uri += '&input=' + txt
README.md https://github.com/a-West/duckduckgo.git | Markdown | 49 lines
4
5[DuckDuckGo](https://duckduckgo.com/) is a general purpose search engine. We've created a platform called [DuckDuckHack](http://duckduckhack.com/) that enables developers to write open source plugins on top of the search engine (like [add-ons for Firefox](https://addons.mozilla.org/en-US/firefox/addon/duckduckgo-for-firefox/?src=ss)). DuckDuckGo plugins react to search queries and provide [useful](https://duckduckgo.com/?q=%40duckduckgo) [instant](https://duckduckgo.com/?q=roman+xvi) [answers](https://duckduckgo.com/?q=private+ips) above traditional links.
6
8
9If you want to get involved in making DuckDuckGo a better search engine, you've come to the right place! 
10
12* If **you are not a developer, but would like to become one** to help with DuckDuckHack, we recommend the [JavaScript course at Codecademy](http://www.codecademy.com/tracks/javascript). That will help you to get started with the Spice plugin type (explained below).
13* If **you have no intention of becoming a developer**, there is still a lot you can do at our [ideas companion site](http://ideas.duckduckhack.com/) where you can suggest and comment on plugin ideas such as identifying the best sites and data sources to draw from. Similarly, you can submit [issues about current plugins](https://github.com/duckduckgo/duckduckgo/issues?direction=desc&sort=created&state=open). Both of these activities are very valuable and will help direct community efforts.
14
15The DuckDuckHack platform is constantly changing as community contributors add new features. As a result, some plugin types have better interfaces than others. We will be improving the platform based on [your feedback](https://www.listbox.com/subscribe/?list_id=197814).
16Our long-term goal is to be able to distribute all DuckDuckHack (and internal) instant answers via the [DuckDuckGo Instant Answers API](https://api.duckduckgo.com). 
17Currently [fathead](https://github.com/duckduckgo/zeroclickinfo-fathead) and [goodie](#goodies-overview) plugin types 
32* [Spice Walkthrough](documentation/spice_overview.md)
33* [Fathead Overview](https://github.com/duckduckgo/zeroclickinfo-fathead)
34* [Longtail Overview](https://github.com/duckduckgo/zeroclickinfo-longtail)
calc.py https://github.com/myano/jenni.git | Python | 267 lines
5Copyright 2009-2013, Michael Yanovich (yanovich.net)
6Copyright 2008-2013, Sean B. Palmer (inamidst.com)
7Licensed under the Eiffel Forum License 2.
27c_answer = re.compile(c_pattern)
28r_tag = re.compile(r'<(?!!)[^>]+>')
29
62    ## Attempt #1 (Google)
63    uri_base = 'http://www.google.com/search?gbv=1&q='
64    uri = uri_base + web.urllib.quote(temp_q)
114            if attempt_two:
115                new_url = 'https://duckduckgo.com/html/?q=%s&kl=us-en&kp=-1' % (web.urllib.quote(q))
116                try:
145                #### Attempt #3 (DuckDuckGo's API)
146                ddg_uri = 'https://api.duckduckgo.com/?format=json&q='
147                ddg_uri += urllib.quote(q)
search.py https://github.com/0x705h/jenni.git | Python | 341 lines
128    jenni.say(reply)
129gcs.commands = ['gcs', 'comp']
130
196        output = duck_api_results['Results'][0]['FirstURL']
197    elif 'AbstractURL' in duck_api_results and min_size('AbstractURL', duck_api_results):
198        ## if there is no 'result', let's try AbstractURL
200        output = duck_api_results['AbstractURL']
201    elif 'RelatedTopics' in duck_api_results and min_size('RelatedTopics', duck_api_results):
202        ## if we still can't find a search result, let's grab a topic URL
214        ## let's try scraping the html page
215        uri = 'https://duckduckgo.com/html/?q=%s&kl=us-en&kp=-1' % web.urllib.quote(query)
216        page = web.get(uri)
238    query = web.urllib.quote(query)
239    uri = 'https://api.duckduckgo.com/?q=%s&format=json&no_html=1&no_redirect=1&kp=-1' % query
240    results = web.get(uri)
search.py https://bitbucket.org/ebarrier/botnet-sopel.git | Python | 158 lines
38
39r_duck = re.compile(r'nofollow" class="[^"]+" href="(?!(?:https?:\/\/r\.search\.yahoo)|(?:https?:\/\/duckduckgo\.com\/y\.js)(?:\/l\/\?kh=-1&amp;uddg=))(.*?)">')
40
59    if '!bang' in query.lower():
60        return 'https://duckduckgo.com/bang.html'
61
62    # This fixes issue #885 (https://github.com/sopel-irc/sopel/issues/885)
63    # It seems that duckduckgo api redirects to its Instant answer API html page
64    # if the query constains special charactares that aren't urlencoded.
66    query = quote_plus(query)
67    uri = 'https://api.duckduckgo.com/?q=%s&format=json&no_html=1&no_redirect=1' % query
68    results = json.loads(web.get(uri))
148    # an alternative suggestion API.
149    uri = 'https://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q='
150    answer = xmltodict.parse(web.get(uri + query.replace('+', '%2B')))['toplevel']
search.rb https://github.com/Oblomov/rbot.git | Ruby | 506 lines
6# Author:: Tom Gilbert (giblet) <tom@linuxbrit.co.uk>
7# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
8#
18GOOGLE_SEARCH = "http://www.google.com/search?oe=UTF-8&q="
19GOOGLE_WAP_SEARCH = "http://www.google.com/m/search?hl=en&q="
20GOOGLE_WAP_LINK = /"r">(?:<div[^>]*>)?<a href="([^"]+)"[^>]*>(.*?)<\/a>/im
25
26DDG_API_SEARCH = "http://api.duckduckgo.com/?format=xml&no_html=1&skip_disambig=1&no_redirect=0&q="
27
27
28WOLFRAM_API_SEARCH = "http://api.wolframalpha.com/v2/query?input=%{terms}&appid=%{key}&format=plaintext"
29           "&scantimeout=3.0&podtimeout=4.0&formattimeout=8.0&parsetimeout=5.0"
30           "&excludepodid=SeriesRepresentations:*"
31WOLFRAM_API_KEY = "4EU37Y-TX9WJG3JH3"
32
duckduckgo.js https://github.com/johnkpaul/protobot.git | JavaScript | 38 lines
4
5/* ---------------------------- DuckDuckGo ---------------------------- */
6function DuckDuckGo() {
9DuckDuckGo.prototype.search = function( query, cloudback ) {
10  exec("curl 'http://api.duckduckgo.com/?format=json&q=" + escape( query ) + "'", function ( err, stdout, stderr ) {
11    var results = JSON.parse( stdout ) // What could possibly go wrong?
16function register( j ) {
17  var ddg = new DuckDuckGo()
18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21