Skip to content

Instantly share code, notes, and snippets.

@nyancodeid
Last active December 17, 2021 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyancodeid/c6f5fc4eba26aac1b1efee6b89e8a4be to your computer and use it in GitHub Desktop.
Save nyancodeid/c6f5fc4eba26aac1b1efee6b89e8a4be to your computer and use it in GitHub Desktop.
DenoQL Showcase
{
cnn: page(url: "https://www.cnnindonesia.com/") {
international_news: query(selector: "a.gtm_navbar_internasional") {
data: parent {
news: queryAll(selector: "article") {
title: text(selector: "h2.title")
thumbnail: src(selector: "img")
link: href(selector: "a")
detail: query(selector: "a") {
meta: visit {
keywords: attr(selector: "meta[name='keywords']", name: "content")
description: attr(selector: "meta[name='description']", name: "content")
}
}
}
}
}
technology_news: query(selector: "a.gtm_navbar_teknologi") {
data: parent {
news: queryAll(selector: "article") {
title: text(selector: "h2.title")
thumbnail: src(selector: "img")
link: href(selector: "a")
detail: query(selector: "a") {
meta: visit {
keywords: attr(selector: "meta[name='keywords']", name: "content")
description: attr(selector: "meta[name='description']", name: "content")
}
}
}
}
}
sport_news: query(selector: "a.gtm_navbar_olahraga") {
data: parent {
news: queryAll(selector: "article") {
title: text(selector: "h2.title")
thumbnail: src(selector: "img")
link: href(selector: "a")
detail: query(selector: "a") {
meta: visit {
keywords: attr(selector: "meta[name='keywords']", name: "content")
description: attr(selector: "meta[name='description']", name: "content")
}
}
}
}
}
}
}
{
detik: page(url: "https://inet.detik.com/") {
articles: queryAll(selector: "article.list-content__item.article_inview") {
title: attr(selector: ".media__image > a", name: "dtr-ttl")
link: attr(name: "i-link")
details: visit_custom(name: "i-link") {
thumbnail: meta(name: "thumbnailUrl")
description: meta(name: "description")
keywords: meta(name: "keywords")
author: meta(name: "author")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment