MyNixOS website logo
Description

Extract Information from Google's "Popular Times".

Once you've identified a real life place, such as a shop, a restaurant, a bar, etc. use this package to simulate a Google search and retrieve its "Popular Times" and geographic location information and save them in Comma-Separated Values files. This package also downloads a list of restaurants and bars of Ushuaia city, Argentina.

sgat

The goal of sgat package is to retrieve information from Google’s searches’ “Popular Times” and geolocation.

Installation

You can install the released version of sgat package from CRAN with:

install.packages("sgat")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("matiaspoullain/sgat")

Example

Always start by initializing the driver, once per session:

library(sgat)
initialization_sgat()
#> [1] "Connecting to remote server"
#> $acceptInsecureCerts
#> [1] FALSE
#> 
#> $browserName
#> [1] "firefox"
#> 
#> $browserVersion
#> [1] "85.0.2"
#> 
#> $`moz:accessibilityChecks`
#> [1] FALSE
#> 
#> $`moz:buildID`
#> [1] "20210208133944"
#> 
#> $`moz:geckodriverVersion`
#> [1] "0.28.0"
#> 
#> $`moz:headless`
#> [1] FALSE
#> 
#> $`moz:processID`
#> [1] 57600
#> 
#> $`moz:profile`
#> [1] "C:\\Users\\Matias\\AppData\\Local\\Temp\\rust_mozprofileLtDB4f"
#> 
#> $`moz:shutdownTimeout`
#> [1] 60000
#> 
#> $`moz:useNonSpecCompliantPointerOrigin`
#> [1] FALSE
#> 
#> $`moz:webdriverClick`
#> [1] TRUE
#> 
#> $pageLoadStrategy
#> [1] "normal"
#> 
#> $platformName
#> [1] "windows"
#> 
#> $platformVersion
#> [1] "10.0"
#> 
#> $rotatable
#> [1] FALSE
#> 
#> $setWindowRect
#> [1] TRUE
#> 
#> $strictFileInteractability
#> [1] FALSE
#> 
#> $timeouts
#> $timeouts$implicit
#> [1] 0
#> 
#> $timeouts$pageLoad
#> [1] 300000
#> 
#> $timeouts$script
#> [1] 30000
#> 
#> 
#> $unhandledPromptBehavior
#> [1] "dismiss and notify"
#> 
#> $webdriver.remote.sessionid
#> [1] "2c38b83d-cbc5-4f53-b942-cd79560428dd"
#> 
#> $id
#> [1] "2c38b83d-cbc5-4f53-b942-cd79560428dd"

This package was created to use it on restaurants, bars, etc… located in Ushuaia city, Tierra del Fuego, Argentina. You can retrieve a vector of them by using the next code:

restaurants <- ushuaia_restaurants()
head(restaurants)
#> [1] "Moustacchio, San Martín 298, Ushuaia"      
#> [2] "Prana, Av Maipu 505, Ushuaia"              
#> [3] "Kuar, Av Perito Moreno 2232, Ushuaia"      
#> [4] "Kuar 1900, San Martín 471, Ushuaia"        
#> [5] "Hostal del Bosque, Magallanes 709, Ushuaia"
#> [6] "Sur 54 Lodge, A 70 Km de Ushuaia, Ushuaia"

You can retrieve the information from some of these restaurants. The searches are not restricted to Ushuaia, but remember to be specific in your searches, specially if the location you are looking for is far away:

bar_1 <- sgat("coutume, 47 rue de babylone, 75007 paris, france")
head(bar_1)
#>                                              lugar   dia hora concurrencia
#> 1 coutume, 47 rue de babylone, 75007 paris, france lunes    6         0.00
#> 2 coutume, 47 rue de babylone, 75007 paris, france lunes    7         0.00
#> 3 coutume, 47 rue de babylone, 75007 paris, france lunes    8        12.75
#> 4 coutume, 47 rue de babylone, 75007 paris, france lunes    9        22.50
#> 5 coutume, 47 rue de babylone, 75007 paris, france lunes   10        21.00
#> 6 coutume, 47 rue de babylone, 75007 paris, france lunes   11        15.00
#>    latitud longitud fecha.de.busqueda
#> 1 48.85166 2.318299        2021-02-12
#> 2 48.85166 2.318299        2021-02-12
#> 3 48.85166 2.318299        2021-02-12
#> 4 48.85166 2.318299        2021-02-12
#> 5 48.85166 2.318299        2021-02-12
#> 6 48.85166 2.318299        2021-02-12

Although, some other Google searches doesn’t have the wanted information. In that case, NULL is returned:

bar_2 <- sgat("Moustacchio, San Martín 298, Ushuaia", tiempo.espera = 20)
bar_2
#> NULL

You also can search for the information from a single day of the week:

bar_3 <- sgat_day("coutume, 47 rue de babylone, 75007 paris, france", "martes")
head(bar_3)
#>                                              lugar    dia hora concurrencia
#> 1 coutume, 47 rue de babylone, 75007 paris, france martes    6         0.00
#> 2 coutume, 47 rue de babylone, 75007 paris, france martes    7         0.00
#> 3 coutume, 47 rue de babylone, 75007 paris, france martes    8         8.25
#> 4 coutume, 47 rue de babylone, 75007 paris, france martes    9        13.50
#> 5 coutume, 47 rue de babylone, 75007 paris, france martes   10        19.50
#> 6 coutume, 47 rue de babylone, 75007 paris, france martes   11        24.75
#>    latitud longitud fecha.de.busqueda
#> 1 48.85166 2.318299        2021-02-12
#> 2 48.85166 2.318299        2021-02-12
#> 3 48.85166 2.318299        2021-02-12
#> 4 48.85166 2.318299        2021-02-12
#> 5 48.85166 2.318299        2021-02-12
#> 6 48.85166 2.318299        2021-02-12

A new function was added which let’s the user to search for the most popular places of a city or area according to Tripadvisor:

pinamar <- tripadvisor_places("Pinamar, Argentina", 10)
pinamar
#>  [1] "La Jirafa"              "Palote Pizza"           "Los troncos"           
#>  [4] "La Armonía"             "Paxapoga del Mar"       "Rada Beach Demuru"     
#>  [7] "Il Garda"               "Parador Barlovento"     "Pescaderia Di Costanzo"
#> [10] "Tante"
Metadata

Version

0.9

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows