
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
OpenWeatherMap.Cache
Advanced tools
An asynchronous .NET Standard 2.0 library that allows you to fetch & cache current weather readings from the OpenWeather API, with built-in resiliency that can extend the cache lifetime in case the API is unreachable.
An asynchronous .NET Standard 2.0 library that allows you to fetch & cache current weather readings from the OpenWeather API, with built-in resiliency that can extend the cache lifetime in case the API is unreachable.
Supports .NET Framework 4.6.1 or later, .NET Core 2.0 or later, and .NET 5.0 or later.
The recommended means is to use NuGet, but you could also download the source code from here.
If the time elapsed since the last fetch for the given location exceeds the cache period (i.e. a new API call is required) but is within the resiliency period (i.e. the previous readings are still available in the cache), the API reported measured time in the cache value is sometimes more recent than the latest value fetched from the API. There are three modes to tackle this issue:
With FetchMode.AlwaysUseLastMeasured, the value still available in the cache is returned. The implication is that if you immediately request another reading it will also hit the API again. IMPORTANT: Frequent calls may impact your API usage.
With FetchMode.AlwaysUseLastMeasuredButExtendCache (default, recommended), the value still available in the cache is returned but in order to protect impact on your API usage, this setting updates the cache value's fetched date and extends the cache lifetime.
With FetchMode.AlwaysUseLastFetchedValue, the last fetched API result is returned anyway, even though it is being reported to be older by the API.
In your Startup.cs (ConfigureServices):
services.AddOpenWeatherMapCache("[API KEY]", 9_500, FetchMode.AlwaysUseLastMeasuredButExtendCache, 300_000);
Then you can inject IOpenWeatherMapCache.
Create your own instance:
var openWeatherMapCache = new OpenWeatherMapCache("[API KEY]", 9_500, FetchMode.AlwaysUseLastMeasuredButExtendCache, 300_000);
var locationQuery = new OpenWeatherMap.Cache.Models.Location(47.6371, -122.1237);
var readings = await openWeatherMapCache.GetReadingsAsync(locationQuery);
if (readings.IsSuccessful)
{
...
}
else
{
var apiErrorCode = readings.Exception?.ApiErrorCode;
var apiErrorMessage = readings.Exception?.ApiErrorMessage;
}
or by zip code (post code) and country code:
var locationQuery = new OpenWeatherMap.Cache.Models.ZipCode("94040", "us");
var readings = await openWeatherMapCache.GetReadingsAsync(locationQuery);
if (readings.IsSuccessful)
{
...
}
else
{
var apiErrorCode = readings.Exception?.ApiErrorCode;
var apiErrorMessage = readings.Exception?.ApiErrorMessage;
}
var locationQuery = new OpenWeatherMap.Cache.Models.Location(47.6371, -122.1237);
var readings = openWeatherMapCache.GetReadings(locationQuery);
if (readings.IsSuccessful)
{
...
}
else
{
var apiErrorCode = readings.Exception?.ApiErrorCode;
var apiErrorMessage = readings.Exception?.ApiErrorMessage;
}
or by zip code (post code) and country code:
var locationQuery = new OpenWeatherMap.Cache.Models.ZipCode("94040", "us");
var readings = openWeatherMapCache.GetReadings(locationQuery);
if (readings.IsSuccessful)
{
...
}
else
{
var apiErrorCode = readings.Exception?.ApiErrorCode;
var apiErrorMessage = readings.Exception?.ApiErrorMessage;
}
FAQs
An asynchronous .NET Standard 2.0 library that allows you to fetch & cache current weather readings from the OpenWeather API, with built-in resiliency that can extend the cache lifetime in case the API is unreachable.
We found that openweathermap.cache demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.