Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdrake-se

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdrake-se - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

.gitpod.yml

4

Engines/Yahoo.js

@@ -100,3 +100,3 @@ /***

Publisher: Buffer.Publishers[Index],
PubslihedAt: Buffer.PublishedDates[Index]
PublishedAt: Buffer.PublishedDates[Index]
}))

@@ -125,2 +125,2 @@ };

module.exports = YahooEngine;
module.exports = YahooEngine;

@@ -22,2 +22,3 @@ /***

const SuggestEngine = require('./Engines/Suggest');
const WikipediaEngine = require('./Engines/Wikipedia');

@@ -33,2 +34,3 @@ module.exports = async ({ Method, Query, Page = 1, Language = 'en-US' }) => {

Ask: new AskEngine(Arguments),
Wikipedia: new WikipediaEngine(Arguments)
};

@@ -44,2 +46,10 @@ if(Method === 'Images')

]);
else if(Method === 'Wikipedia')
return await Promise.any([
Instances.Wikipedia.Wiki()
]);
else if(Method === 'Wikipedia.Suggest')
return await Promise.any([
Instances.Wikipedia.Suggest()
]);
else if(Method === 'Suggest')

@@ -46,0 +56,0 @@ return await SuggestEngine(Query);

{
"name": "cdrake-se",
"version": "1.0.4",
"version": "1.0.5",
"description": "A library that will make your life easier when you want to search the internet, not pay APIs, search from your computer for free!",

@@ -23,4 +23,4 @@ "author": "Rodolfo Herrera Hernandez @codewithrodi",

"books",
"links",
"internet",
"wikipedia",
"engine",
"scraper",

@@ -44,4 +44,7 @@ "cheerio",

"cheerio": "^1.0.0-rc.10",
"node-suggest": "^1.0.2"
"i": "^0.3.7",
"node-suggest": "^1.0.2",
"npm": "^9.2.0",
"wikipedia": "^2.0.0"
}
}

@@ -423,2 +423,59 @@ # CDrake-SE

```
##### Gathering information from a Wikipedia page or biography
You can collect a lot of information by requesting a search of the Wikipedia databases, if this search exactly matches one it will return a ton of information that is organized inside an object, in case, there is no page in based on your search a { Status: 'Error' } will be returned.
```javascript
// ! Importing the library to perform the search
const SearchEngine = require('cdrake-se');
// ! Creating an asynchronous function that will be executed
// ! automatically when the script is initialized, which will
// ! search for information and display it on the screen
(async function(){
try{
const LinusTorvaldsWikipediaPage = await SearchEngine({
// ! We indicate the method, in this case Wikipedia <SEARCH>
Method: 'Wikipedia',
// ! We indicate the query, in this case Linus Torvalds to return us information related to Linus Torvalds
Query: 'Linus Torvalds',
// ! We indicate the language
Language: 'en'
});
console.log(LinusTorvaldsWikipediaPage);
}catch(SearchRuntimeError){
// ! If an error occurs, we will display it in the terminal
console.log(SearchRuntimeError);
}
}());
```
##### Using the Wikipedia suggestion engine.
Apart from the search suggestion that the engine has, you can use the suggestion engine that Wikipedia has, so that you can obtain existing links within their respective databases to access them.
```javascript
// ! Importing the library to perform the search
const SearchEngine = require('cdrake-se');
// ! Creating an asynchronous function that will be executed
// ! automatically when the script is initialized, which will
// ! search for information and display it on the screen
(async function(){
try{
const ElonWikipediaSearchSuggests = await SearchEngine({
// ! We indicate the method, in this case Wikipedia Suggestion
Method: 'Wikipedia.Suggest',
// ! We indicate the query, in this case Elon to return us suggestions
Query: 'Elon',
// ! We indicate the language
Language: 'en'
});
console.log(ElonWikipediaSearchSuggests);
}catch(SearchRuntimeError){
// ! If an error occurs, we will display it in the terminal
console.log(SearchRuntimeError);
}
}());
```
### Contributions and future versions

@@ -425,0 +482,0 @@ This library along with its real world usage example web service will continue to receive updates, improvements and bug fixes, I decided to make the engine that uses the codexdrake library search web service so that other developers can experiment with it, create better stuff and update them if they fucking want to, they can do whatever they want with the code.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc