Skip to content

Instantly share code, notes, and snippets.

@Niwilai
Created September 19, 2021 13:06
Show Gist options
  • Save Niwilai/136664af5bba41f1d48778fc6c4d94aa to your computer and use it in GitHub Desktop.
Save Niwilai/136664af5bba41f1d48778fc6c4d94aa to your computer and use it in GitHub Desktop.
Check if given game is on PSN store
require 'google_search_results'
params = {
q: "#{ARGV[0]} - PS Store",
hl: "de",
gl: "de",
google_domain: "google.de",
num: 10,
api_key: "FAKE_KEY"
}
search = GoogleSearch.new(params)
hash_results = search.get_hash
hash_results[:organic_results].each do |entry|
if entry[:link].include?("store.playstation")
puts "#{ARGV[0]} looks like: #{entry[:title]}"
else
puts "Not found :("
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment