
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
== Geosack On Rails
This plugin enables you to utilize geosack.com unique geocode caching service. Geosack provides a persistent api that caches google-map/geocode lookups - enabling you to re-request the same information any number of times you like without exceeding your quota's or rate-limits from google.
To install the plugin, extract the files from the archive to a directory named "geosack" in your vendors/plugin directory.
Using the plugin is straightforward:
To use the geocoding service you will need a google API key, obtained from here:
http://code.google.com/apis/maps/signup.html
Once you have this key, you can create your Geosack object:
geosack = Geosack::Base.new(:api_key => YOUR_API_KEY)
Then you are free to start making geocode requests.
result, location = geosack.geo(:q => 'San Jose')
The placename to be looked is specified by the :q parameter. The only other parameter is :output which is the response format - KML/XML/JSON. The default response format is XML.
You don't need to worry about the 2 second delay that google requires - geosack takes care of that for you.
The result object is a reflection of the response returned by google to your request. Anything other than a 200 (G_GEO_SUCCESS) is a failure.
You will also need to check for 610 (G_GEO_TOO_MANY_QUERIES) responses which indicate you have reached your limit for the 24 period. Note that this limit only applies to new requests sent to google - if you send a request that has already been cached by geosack, the response will come from geosack, not from google, and your daily limit will be unaffected.
Heres an example to get your started:
geosack = Geosack::Base.new(:key => API_KEY) result, resp = geosack.geo(:q => lookup) if result == Geosack::StatusCodes::G_GEO_SUCCESS doc = REXML::Document.new(resp) doc.root.each_element('//Response') do |response| response.each_element('//Placemark') do |place| longitude,latitude = place.elements['//coordinates'].text.split(',') end end else # failed end
Have fun, and feel free to contact us at mailto:info@packetnode.com with any questions or suggestions.
FAQs
Unknown package
We found that geosack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.