Jump to content

Search the Community

Showing results for tags 'google places'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. The following is an example that fetches name/address/phone number for places of your criteria. If you needed to poll many different locations and aggregate the data, a solution as such may prove useful. As always my hopes is that people see this pile i left, fix the inefficiencies, and the result weeks from now is far finer than this initial offering. You need an API key from google (which is free), in your api console make sure you kick on both maps and places and JSMN from #Include "JSMN.au3" #Include <Array.au3> #Include <File.au3> Global $aFarray Global $aDarray $input1 = inputbox("What Place?" , "Enter the Place Name or Type of Place" , "University") $input2 = inputbox("Where At?" , "Enter the Zip or City" , "76504") $radius = inputbox("Prioritize Returns" , "Priority is given to places within this many meters" , "10000") $sInputs = $input1 & " " & $input2 $location = stringreplace($sInputs , " " , "+") Local $Json = BinaryToString(InetRead("https://maps.googleapis.com/maps/api/place/textsearch/json?query=" & $location & "&radius=" & $radius & "&sensor=false&key=YourKeyHere"), 4) Local $Obj = Jsmn_Decode($Json) $file = fileopen(@ScriptDir & "\JSON_RADIUS_OUTPUT.txt" , 2) filewrite($file , Jsmn_Encode($Obj, $JSMN_PRETTY_PRINT)) fileclose($file) _FileReadToArray(@ScriptDir & "\JSON_RADIUS_OUTPUT.txt" , $aFarray) ;~ _ArrayDisplay($aFarray) For $i = $aFarray[0] to 1 step -1 If stringinstr($aFarray[$i] , '"formatted_address": ') or stringinstr($aFarray[$i] , '"name": ') or stringinstr($aFarray[$i] , '"reference": ') Then ContinueLoop Else _ArrayDelete($aFarray , $i) Endif next _ArrayDelete($aFarray , 0) For $i = 2 to ubound($aFarray) - 1 step 3 $aFarray[$i] = stringtrimright(stringtrimleft($aFarray[$i], 17),2) Local $Json2 = BinaryToString(InetRead("https://maps.googleapis.com/maps/api/place/details/json?reference="& $aFarray[$i] &"&sensor=false&key=YourKeyHere"), 4) Local $Obj2 = Jsmn_Decode($Json2) $file = fileopen(@ScriptDir & "\JSON_Details_OUTPUT.txt" , 2) filewrite($file , Jsmn_Encode($Obj2, $JSMN_PRETTY_PRINT)) fileclose($file) _FileReadToArray(@ScriptDir & "\JSON_Details_OUTPUT.txt" , $aDarray) For $j = 1 to $aDarray[0] If stringinstr($aDarray[$j] , '"formatted_phone_number": ') Then $aFarray[$i] = stringtrimright(stringtrimleft($aDArray[$j], 29),2) Endif next Next $results = Fileopen(@ScriptDir & "\results.txt" , 2) for $k = 0 to ubound($aFArray) - 1 step 3 filewrite($results , stringtrimright(stringtrimleft($aFArray[$k+1], 12),2)) filewrite($results , @CRLF) filewrite($results , stringtrimright(stringtrimleft($aFArray[$k], 25),2)) filewrite($results , @CRLF) filewrite($results , $aFArray[$k+2]) filewrite($results , @CRLF) filewrite($results , @CRLF) Next FileClose ($results) shellexecute(@ScriptDir & "\results.txt")
×
×
  • Create New...