News for hackers. Stuff that matters.
Re:BitBar: put the output from any script/program in your Ma... by sciencerobot on Tuesday January 05, 2016 @12:21AM (#10841369)
Awesome tool! I've always wanted to make menubar apps but never wanted to learn Xcode+ObjectiveC.

Related:

Is there no simple way to get the current temperature for location based off of GeoIP using `curl`?

I had to use this monstrosity to get the current temperature:

    #!/bin/bash

    export PATH='/usr/local/bin:$PATH'

    ansiweather -a off -l 'San Francisco' \
      | cut -d '>' -f 2 \
      | cut -d '-' -f1 \
      | awk '{ print $1 $2 }' \
      | tr -d 'C'
Re:BitBar: put the output from any script/program in your Ma... by taylorzane on Tuesday January 05, 2016 @01:31AM (#10841638)
You could use OpenWeatherMap's API. Something like this is pure (remove the `&units=imperial` if you prefer Celsius):

    curl -s "http://api.openweathermap.org/data/2.5/weather?zip=$(curl -s ipinfo.io/postal),us&appid=2de143494c0b295cca9337e1e96b00e0&units=imperial" \
      | sed -e 's/\(.*\)temp":\([0-9.]*\),\(.*\)/\2/'
or you could replace the `sed` pipe with a call to `jq`:

    curl really_long_url | jq '.main.temp'
Re:BitBar: put the output from any script/program in your Ma... by mkagenius on Tuesday January 05, 2016 @02:23AM (#10841821)
> remove the `&units=imperial` if you prefer Celsius

That would get you Kelvin, use `&units=metric` for Celsius

Re:BitBar: put the output from any script/program in your Ma... by taylorzane on Tuesday January 05, 2016 @10:06AM (#10843540)
Good call! I completely forgot the default units were in Kelvin, and not Celsius.
Re:BitBar: put the output from any script/program in your Ma... by grahamg on Tuesday January 05, 2016 @01:10AM (#10841573)
Not curl, but this script may be a worthy replacement? https://raw.githubusercontent.com/grahamg/Practice/master/we...