{"action":"created","issue":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/3485","labels_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/3485/labels{/name}","comments_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/3485/comments","events_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/3485/events","html_url":"https://github.com/robbyrussell/oh-my-zsh/issues/3485","id":53991173,"number":3485,"title":"Add new plugin for ansi weather","user":{"login":"pickfire","id":4687791,"avatar_url":"https://avatars.githubusercontent.com/u/4687791?v=3","gravatar_id":"","url":"https://api.github.com/users/pickfire","html_url":"https://github.com/pickfire","followers_url":"https://api.github.com/users/pickfire/followers","following_url":"https://api.github.com/users/pickfire/following{/other_user}","gists_url":"https://api.github.com/users/pickfire/gists{/gist_id}","starred_url":"https://api.github.com/users/pickfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pickfire/subscriptions","organizations_url":"https://api.github.com/users/pickfire/orgs","repos_url":"https://api.github.com/users/pickfire/repos","events_url":"https://api.github.com/users/pickfire/events{/privacy}","received_events_url":"https://api.github.com/users/pickfire/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/labels/Feature%20Request","name":"Feature Request","color":"ffdd03"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-11T13:02:09Z","updated_at":"2015-02-27T16:22:36Z","closed_at":null,"body":"Add new plugin for https://github.com/fcambus/ansiweather"},"comment":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/comments/76421942","html_url":"https://github.com/robbyrussell/oh-my-zsh/issues/3485#issuecomment-76421942","issue_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/3485","id":76421942,"user":{"login":"pickfire","id":4687791,"avatar_url":"https://avatars.githubusercontent.com/u/4687791?v=3","gravatar_id":"","url":"https://api.github.com/users/pickfire","html_url":"https://github.com/pickfire","followers_url":"https://api.github.com/users/pickfire/followers","following_url":"https://api.github.com/users/pickfire/following{/other_user}","gists_url":"https://api.github.com/users/pickfire/gists{/gist_id}","starred_url":"https://api.github.com/users/pickfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pickfire/subscriptions","organizations_url":"https://api.github.com/users/pickfire/orgs","repos_url":"https://api.github.com/users/pickfire/repos","events_url":"https://api.github.com/users/pickfire/events{/privacy}","received_events_url":"https://api.github.com/users/pickfire/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T16:22:35Z","updated_at":"2015-02-27T16:22:35Z","body":"Look at this, not much customisation, it just works. Currently, can only change the `units`:\r\n```bash\r\n#!/bin/bash\r\n#\r\n# A script to get current weather\r\n#\r\n# To change the ui, move to presentation time. The what is a good function.\r\n# Units: metric, imperial, \"\" for internal\r\nunits=\"metric\"\r\n\r\n\r\nfunction what() { # Function to get value for geo_data\r\n  for i in ${data[@]}; do echo $i; done | sed -n \"s/$1.*:// p\" | head -n 1\r\n}\r\n\r\n# Data should only be get once: geo_data -> wea_data\r\ndata=( $(curl -s http://www.telize.com/geoip | sed 's/[{}\"]//g;s/,/ /g') )\r\ndata=( $(curl -s \"http://api.openweathermap.org/data/2.5/weather?lat=$(what lat)&lon=$(what lon)&lang=$LANG&units=$units\" | sed 's/[{}\"]//g;s/ /_/g;s/,/ /g') )\r\n\r\n# Units measurement\r\ncase $units in\r\n  metric) scale=\"°C\"; speed=\"m/s\"; Pa=\"hPa\" ;;\r\n  imperial) scale=\"°F\"; speed=\"mph\"; Pa=\"inHg\" ;;\r\nesac\r\n\r\n# Presentation time\r\necho -e \"There must be \\e[31m$(what main)\\e[m in \\e[31m$(what name|tr \"_\" \" \")\\e[m\r\n\\e[32mTemperature\\e[m: $(what temp_min)$scale - $(what temp_max)$scale\\t\\e[32mHumidity\\e[m: $(what humid)\"\r\n```"}}