mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 22:53:06 -04:00
add news
This commit is contained in:
parent
5b7e9841a4
commit
3a016dde3d
5 changed files with 154 additions and 1 deletions
|
@ -40,6 +40,8 @@ const Api = Object.freeze({
|
|||
SEARCH_BING_IMAGES: '/search/bing-images',
|
||||
SEARCH_GOOGLE: '/search/google',
|
||||
SEARCH_GOOGLE_IMAGES: '/search/google-images',
|
||||
SEARCH_GOOGLE_NEWS: '/search/google-news',
|
||||
SEARCH_GOOGLE_NEWS_SUPPLEMENTAL: '/search/google-news-supplemental',
|
||||
SEARCH_LYRICS: '/search/lyrics',
|
||||
SEARCH_MAPS: '/search/maps',
|
||||
SEARCH_MAPS_SUPPLEMENTAL: '/search/maps-supplemental',
|
||||
|
|
|
@ -126,6 +126,18 @@ module.exports.googleImages = async function(context, query, nsfw){
|
|||
})
|
||||
}
|
||||
|
||||
module.exports.googleNews = async function(context, query, nsfw){
|
||||
return await request(Api.SEARCH_GOOGLE_NEWS, "GET", {}, {
|
||||
q: query
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.googleNewsSupplemental = async function(context, supplementalKey){
|
||||
return await request(Api.SEARCH_GOOGLE_NEWS_SUPPLEMENTAL, "GET", {}, {
|
||||
supplemental_key: supplementalKey
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.lyrics = async function(context, query){
|
||||
return await request(Api.SEARCH_LYRICS, "GET", {}, {
|
||||
q: query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue