Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Robustly identify countries, states, islands, cities and whatnot from text. This is still BETA. Although it supports most countries and states, it still lacks regions and cities for the most part of the world.
What if I ask you: "What region is 'ontario'", or "where is 'ca'"? I would answer: Ontario is a state in Canada as well as a city in California. CA is the ISO abbreviation for Canada, and also the abbreviation for California.
The goal of this gem is such: Given a string, do your very best to identify all possible locations, and order them by significance. Provide as much information as possible; What kind of region is this? Country? City? Island? Continent?
require 'spotter'
spotter = Spotter.new
results = spotter.identify('new york')
puts results.first.to_s # => "United States, New York"
puts results.first.regions[0].name # => "United States"
puts results.first.regions[0].type # => "country"
puts results.first.regions[1].name # => "New York"
puts results.first.regions[1].type # => "state"
It can handle text in different cases, spellings, etc.
spotter.identify('ontARIO, california').first.to_s
# => "United States, California, San Bernardino, Ontario"
spotter.identify('росСиЯ').first.to_s # => 'Russia'
spotter.identify('ruSSia').first.to_s # => 'Russia'
It returns all matches found:
results = spotter.identify('canada')
puts results[0].to_s # => 'Canada'
puts results[1].to_s # => 'United States, Kansas, Canada'
It works with abbreviations too:
puts spotter.identify('se').first.to_s # => 'Sweden'
You can also use the gem with the rake task identify
as such:
rake identify['new york']
FAQs
Unknown package
We found that region-spotter 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.