Created
June 24, 2018 03:29
-
-
Save Salada/50078120e8d6209c0d252984d79f53a1 to your computer and use it in GitHub Desktop.
병신같은 스크립트
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://94he6yatei-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.24.5%3Binstantsearch.js%202.3.3%3BJS%20Helper%202.23.0&x-algolia-application-id=94HE6YATEI&x-algolia-api-key=2414d3366df67739fe6e73dad3f51a43" | |
var modelParser = function(str) { | |
var baseModel = { | |
"requests":[ | |
{ | |
"indexName":"steamdb", | |
"params":"query="+str+"&hitsPerPage=20&maxValuesPerFacet=1000&page=0&facets=%5B%22tags%22%2C%22multiplayerCategories%22%2C%22categories%22%2C%22vrCategories%22%2C%22oslist%22%2C%22price_us%22%2C%22appType%22%2C%22userScore%22%2C%22developer%22%2C%22publisher%22%5D&tagFilters=&facetFilters=%5B%5B%22appType%3AGame%22%5D%5D" | |
}, | |
{ | |
"indexName":"steamdb", | |
"params":"query="+str+"&hitsPerPage=1&maxValuesPerFacet=1000&page=0&attributesToRetrieve=%5B%5D&attributesToHighlight=%5B%5D&attributesToSnippet=%5B%5D&tagFilters=&analytics=false&facets=appType" | |
} | |
]}; | |
return baseModel; | |
} | |
function myFunction(str) { | |
if (str != null) { | |
var response = UrlFetchApp.fetch(url, { | |
"method": "POST", | |
"payload" : JSON.stringify(modelParser(str)) | |
}); | |
var what = JSON.parse(response.getContentText()); | |
var real = what.results[1].hits[0].objectID | |
return real; | |
} | |
return ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gist를 cdn으로 악용하기