Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
hubot-polish-weather
Advanced tools
Readme
Hubot script that allows to display information about weather in polish cities for today and 5 days in the future using only free API.
It's power lies in the fuzzy matching of cities and days - polish languages is very flexible and it's hard to predict all the cases.
It uses the OpenWeather API to get weather forecasts for the specific city and the GeoNames API to get correct name for the city (in the nominative case).
First step is to include the hubot-polish-weather
dependency to your Hubot scripts (inside the package.json file). Then
all you have to do is to update your external-scripts.json
file to include our library. If this file is missing, simply
create it with content:
["hubot-polish-weather"]
This module requires you to set up keys for the APIs.
HUBOT_WEATHER_OW_API_KEY
environment variableHUBOT_WEATHER_GN_USER
environment variableThe bot will show information about all weathers forecast for the day on this specific hour. Additionally, it will also display general data like temperature, humidity and pressure.
Pogoda dla miasta Poznań jutro o 13:00:
Moja urocza pogodynka opisała pogodę w taki sposób: :partly_sunny:rozproszone chmury.
Garść statystyk: :thermometer:1.54 stopni Celsjusza, :cityscape:94 wilgotności, natomiast :stopwatch:ciśnienie wynosi 1002.82 hPa
I tried to make this library as flexible for the user as possible.
If the user will pass only the name for the city, the library will assume, that he wants to see current weather forecast:
hubot pogoda dla Gdańska
hubot pogoda w Krakowie
The bot will ignore diacritics and will display the weather forecast for the city with the biggest population in case of more matching cities.
After first usage, the bot will remember last checked city for every user. It means that in this case he can just write:
hubot pogoda w Warszawie
hubot pogoda
... and the bot will remember in the second case, that it should check the Warsaw city.
You can also tell the bot to check the weather forecast for maximum 5 days (since in the free version, the API only allows so much days to be forecast). Because of this, I've decided to use the weekday names instead of dates (Monday, Tuesday, tomorrow, today etc.):
hubot pogoda w Warszawie na jutro // weather forecast for tomorrow
hubot pogoda w Warszawie w niedzielę // weather forecast for the Sunday
hubot pogoda w Warszawie we wtorek // weather forecast for the Tuesday
Of course, you can also pass the exact hour to be checked. Since the weather forecasts are done in the 3-hours intervals, the bot will find the closest interval to the passed date:
hubot pogoda w Warszawie o 14:30 // will show weather forecast for today, 15:00
hubot pogoda w Warszawie w poniedziałek o 18:00 // will show weather forecast for Monday, 18:00
hubot pogoda w Warszawie na jutro o 12:10 // will show weather forecast for tomorrow, 12:00
I tried to write this library in such a manner that will allow to easily port it to different language. I know that the polish version will not be popular, but there are many other libraries for the english version. Polish version of the library exists only because of the requirement to use full cities and weekday names in the nominative case, which is fairly uncomfortable. If you want help with implementing the fuzzy-logic weather forecast to your own language, feel free to ask me.
If you want to contribute, just fork the project and add some changes!
If you will find any errors with this library or have great idea how to improve it (and don't want to do it on your own), please feel free to open a new ticket.
FAQs
Hubot script that allows to display information about weather in polish cities for today and 5 days in the future using only free API
The npm package hubot-polish-weather receives a total of 0 weekly downloads. As such, hubot-polish-weather popularity was classified as not popular.
We found that hubot-polish-weather 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.