Skip to content

Instantly share code, notes, and snippets.

View hilmanski's full-sized avatar

Hilman Ramadhan hilmanski

View GitHub Profile
@hilmanski
hilmanski / scrape review on Google Maps Reviews API by SerpApi
Created June 19, 2025 00:32
scrape review on Google Maps Reviews API by SerpApi
import requests
SERPAPI_API_KEY = "YOUR_API_KEY"
# data_id= "0x87c0efbfabd07121:0x4d29f6c1222606e7" # thousand reviews
# data_id = "0x2dbee30bfa8faf9b:0x7bda5e20f02979af" # 10-100
# data_id = "0x2dbefd34f300372b:0x5427dc086be165c4" # 100-1000
# data_id = "0x2dbf1d8302c0b94f:0x83758d60d4c55557" #212 reviews
data_id = "0x2dbf02a197360ef1:0x2d1688ef40474288" #473 reviews
params = {
const rows = document.querySelectorAll("table tr");
const firstTdValues = [];
rows.forEach(row => {
const firstTd = row.querySelector("td:first-child");
if (firstTd) {
firstTdValues.push(firstTd.textContent.trim());
}
});
function getData()
{
return `
<div>
<ol class="row">
<li class="col-xs-6 col-sm-4 col-md-3 col-lg-3">
@hilmanski
hilmanski / gist:ebff52f14e5662481788814095e3eb77
Created September 20, 2023 22:24
Simple example web scraping with Ruby for beginner
require 'net/http'
require 'nokogiri'
# HTTP Client
url = 'https://www.w3schools.com'
response = Net::HTTP.get_response(URI(url))
if response.code != "200"
puts "Error: #{response.code}"
exit
@hilmanski
hilmanski / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console