Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59440344 authored by Nivesh Krishna's avatar Nivesh Krishna
Browse files

fix paging and offset in ddg engine

parent 3948411c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -22,8 +22,9 @@ about = {

# engine dependent config
categories = ['general']
paging = False
paging = True
supported_languages_url = 'https://duckduckgo.com/util/u172.js'
number_of_results = 10
time_range_support = True
safesearch = True
VQD_REGEX = r"vqd='(\d+-\d+-\d+)'"
@@ -86,7 +87,7 @@ def request(query, params):
        't': 'D',
        'l': params["language"],
        'kl': get_region_code(params["language"]),
        's': 0,
        's': (params['pageno'] - 1) * number_of_results,
        'dl': 'en',
        'ct': 'US',
        'ss_mkt': get_region_code(params["language"]),
+24 −0
Original line number Diff line number Diff line
const DDG = require('duck-duck-scrape');
// let x = DDG.search('fuck', {
//   safeSearch: DDG.SafeSearchType.STRICT
// }).then((data) => {
//     data["results"].forEach(element => {
//       console.log(element.title, 'STRICT')
//     });
// });

// let y = DDG.search('fuck', {
//   safeSearch: DDG.SafeSearchType.MODERATE
// }).then((data) => {
//   data["results"].forEach(element => {
//     console.log(element.title, 'MODERATE')
//   });
// });

let z = DDG.search('fuck', {
  safeSearch: DDG.SafeSearchType.OFF
}).then((data) => {
  data["results"].forEach(element => {
    console.log(element.title, 'OFF')
  });
});