Google API keys

Posted on
Fri Dec 04, 2015 4:57 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Google API keys

Hi all

In the past Google has allowed users to access Static Maps without an API key. This has now changed and it's now mandatory to have one. The process is free and you can get instructions on how to do this in this forum post - http://forums.indigodomo.com/viewtopic.php?f=181&t=14734.

When you enter your Google API key into the iFindStuff dialog please check that your system doesn't add a <space> on the end or, if it's like mine, pastes it twice or it will return an error!

You'll know if you have an API key issue if you suddenly find that you can't read the jpg files that iFindStuff creates. If you open the rogue file with a text editor like TextEdit you'll see the error message that Google has returned instead of the map.

Best regards

Mike

Posted on
Wed Jul 13, 2016 9:53 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Google API keys

Chameleon wrote:
You'll know if you have an API key issue if you suddenly find that you can't read the jpg files that iFindStuff creates. If you open the rogue file with a text editor like TextEdit you'll see the error message that Google has returned instead of the map.


Mike,

Have you considered using PIL (Pillow) to validate the graphic that is returned from your query. If it's invalid, then you can just output an error, and allow the users to resolve it.

Now, I'm making an assumption here, that you are probably streaming the download to memory, and then saving the file?

http://www.garykessler.net/library/file_sigs.html

89 50 4E 47 0D 0A 1A 0A ‰PNG....
PNG Portable Network Graphics file
Trailer: 49 45 4E 44 AE 42 60 82 (IEND®B`‚...)

The above information is the header bytes of a PNG file. So assuming that Google maps returns a PNG, you could check the first 4-5 bytes, and see if it matches the signature above. If it doesn't, then it simply is *NOT* an PNG file. The header information is from Gary Kessler (See URL above).

- Benjamin

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests