Skip to content

Instantly share code, notes, and snippets.

@PxyUp
Created October 30, 2024 18:21
Show Gist options
  • Save PxyUp/e3aa36ca96dd37da2fe8d2fff17631a8 to your computer and use it in GitHub Desktop.
Save PxyUp/e3aa36ca96dd37da2fe8d2fff17631a8 to your computer and use it in GitHub Desktop.
Steam sales
{
"references": {
"EuSales": {
"connector_config": {
"response_type": "HTML",
"url": "https://gg.deals/deals/?drm=1&minRating=0&platform=1&store=4",
"browser_config": {
"playwright": {
"timeout": 60000,
"wait": 10000,
"browser": "WebKit"
}
}
},
"model": {
"array_config": {
"root_path": ".deals-content #deals-list .list-items > div",
"item_config": {
"fields": {
"name": {
"base_field": {
"type": "string",
"path": ".game-info-title-wrapper a"
}
},
"link": {
"base_field": {
"type": "string",
"path": ".game-cta .shop-link",
"html_attribute": "href",
"generated": {
"formatted": {
"template": "https://gg.deals{PL}"
}
}
}
},
"discount": {
"base_field": {
"type": "string",
"path": ".price-widget .discount"
}
},
"price": {
"base_field": {
"type": "string",
"path": ".price-wrapper span.game-price-new"
}
}
}
}
}
}
}
},
"item": {
"connector_config": {
"response_type": "json",
"reference_config": {
"name": "EuSales"
}
},
"model": {
"base_field": {
"type": "array",
"generated": {
"file_storage": {
"file_name": "sales.md",
"path": "/Users/pxyup/fitter/",
"content": "{{{FromExp=join(map(fromJSON(fResJson), {let name=.name; let link=.link; let price=.price; let discount=.discount; string(#index + 1) + '. [' + reduce(['-', '\\'', '.', '!', '#'], replace(#acc, #, '\\\\' + #), name) + '](' + link + ')' + ' ' + reduce(['-', '\\'', '.', '!', '#'], replace(#acc, #, '\\\\' + #), price) + ' discount *' + discount + '*'}), FNewLine)}}}"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment