SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#26 2014-11-06 18:53:21

boisei0
#! CrunchBanger
From: Gaanderen, Netherlands
Registered: 2013-07-16
Posts: 193

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

Oh right... second bug I forgot to mention wink
Will update the first post right away.
Edit: consider it done tongue

Last edited by boisei0 (2014-11-06 18:59:05)


YAWS (cli weather script with conkyForecast syntax) | Bitbucket | Github | Blog
Member of the Unofficial #! Emergency Tinfoil Hat Distribution Center
Emergency Tinfoil Hat Conky Alert System development team

Offline

Help fund CrunchBang, donate to the project!

#27 2014-11-06 19:24:16

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

lol  lol  lol  lol  lol
Don't you just love bugs.  big_smile

Got it - back in a bit.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#28 2014-11-06 20:00:01

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

I want to shoot myself ...

    $ Conky: '/home/sector11/yaws162/yaws.conky' modified, reloading...
Conky: desktop window (264) is root window
Conky: window type - normal
Conky: drawing to created window (0x2400001)
Conky: drawing to double buffer
Traceback (most recent call last):
  File "/home/sector11/yaws162/yaws.py", line 1084, in <module>
    main()
  File "/home/sector11/yaws162/yaws.py", line 1067, in main
    print(template.parse())
  File "/home/sector11/yaws162/yaws.py", line 316, in parse
    output = self.parse_command(command)
  File "/home/sector11/yaws162/yaws.py", line 391, in parse_command
    output = parse_forecast_arguments(args, self.forecast, self.sunrise, self._cfg, days=startday)
  File "/home/sector11/yaws162/yaws.py", line 906, in parse_forecast_arguments
    city, country = reverse_geocode(cfg)
  File "/home/sector11/yaws162/yaws.py", line 937, in reverse_geocode
    json = requests.get(url, proxies=get_proxies(config)).json()
TypeError: 'dict' object is not callable

What am I doing wrong?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#29 2014-11-06 20:10:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

Learn to Read is very high on my "ToDo List"
boisei0 wrote:

Requirements:
- Python 2.7
- Requests (apt-get install python-requests)
  (Note: the version delivered by aptitude, might give problems. Use the 2.2.1 or later requests version when this occurs)

Installation instructions for Requests, if the Aptitude version gives errors:
Download version 2.2.1 or later. Untar it and execute in the created directory the command

python setup.py install

as root (for example by using sudo).

Now to start tweaking...  :8


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#30 2014-11-09 01:42:01

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

Don't you hate it when life gets in the way of the important things.
Like making a conky.  O:)

Finally here's a 9 day forecast:
2014_11_08_22_25_03_1920x1080_Sector11.jpg

yaws.conky

# pkill -xf "conky -c /media/5/Conky/yaws162/yaws.conky" &

## YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)
## http://crunchbang.org/forums/viewtopic.php?id=28674

###  Begin Window Settings  ##################################################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title YAWS
# own_window_argb_visual yes # Options: yes or no
# own_window_argb_value 0

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

minimum_size 260 0  # w|h
maximum_width 260

gap_x 5	# l|r
gap_y 5	# u|d

alignment tl
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1.0

# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes ##yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #DarkSeaGreen
color1 778899 #LightSlateGray
color2 F5F5DC #Beige
color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 FFA07A #LightSalmon
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 05
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
# text_buffer_size 6144

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable th0e image cache.
imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit
##############################################  End Miscellaneous Section  ###

## lats and Longs: http://www.findlatitudeandlongitude.com/

update_interval 1
#${execpi 600 python /media/5/Conky/yaws162/yaws.py --config /media/5/Conky/yaws162/YAWS.cfg --template /media/5/Conky/yaws162/example/4days_details.template}
#${execpi 600 python /media/5/Conky/yaws162/yaws.py --config /media/5/Conky/yaws162/YAWS.cfg --template /media/5/Conky/yaws162/example/details.template}
#${execpi 600 python /media/5/Conky/yaws162/yaws.py --config /media/5/Conky/yaws162/YAWS.cfg --template /media/5/Conky/yaws162/example/sun-moon.template}
#${execpi 600 python /media/5/Conky/yaws162/yaws.py --config /media/5/Conky/yaws162/YAWS.cfg --template /media/5/Conky/yaws162/example/9days.template}
TEXT
${execpi 600 python /media/5/Conky/yaws162/yaws.py --config /media/5/Conky/yaws162/YAWS.cfg --template /media/5/Conky/yaws162/example/S11-full.template}

And the S11-full.template

${execi 600 echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`}  Max: [--startday=0 --datatype=HT]  Min: [--startday=0 --datatype=LT]
${color8}[--startday=0 --datatype=CC]${color}${image [--startday=0 --datatype=WI] -p 0,30 -s 50x50}
${goto 60} Now: [--startday=0 --datatype=HT] ([--startday=0 --datatype=LT])
${goto 60} Hum: [--startday=0 --datatype=HM]
${goto 60}  DP: [--startday=0 --datatype=DP]
${goto 60} Bar: [--startday=0 --datatype=BR]
Wind: [--hideunits --datatype=WS] km/h | [--startday=0 --datatype=WA] | [--startday=0 --datatype=WD]
 Sun: [--startday=0 --datatype=SR] | ${color8}[--startday=0 --datatype=DL]${color} | [--startday=0 --datatype=SS]
Moon: [--startday=0 --datatype=MR] | [--startday=0 --datatype=MS] | [--startday=0 --datatype=MP]

${execi 600 echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`} → [--startday=1 --datatype=HT] ([--startday=1 --datatype=LT])
${color8}[--startday=1 --datatype=CC]${color}${image [--startday=1 --datatype=WI] -p 0,170 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=1 --datatype=SR]${goto 135}↑ [--startday=1 --datatype=MR]
${goto 60}${color8}→ [--startday=1 --datatype=DL]${color}${goto 135}→ [--startday=1 --datatype=MP]
${goto 60}↓ [--startday=1 --datatype=SS]${goto 135}↓ [--startday=1 --datatype=MS]

${execi 600 echo `date --date="2 day" | awk '{print $1" "$3" "$2}'`} → [--startday=2 --datatype=HT] ([--startday=2 --datatype=LT])
${color8}[--startday=2 --datatype=CC]${color}${image [--startday=2 --datatype=WI] -p 0,268 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=2 --datatype=SR]${goto 135}↑ [--startday=2 --datatype=MR]
${goto 60}${color8}→ [--startday=2 --datatype=DL]${color}${goto 135}→ [--startday=2 --datatype=MP]
${goto 60}↓ [--startday=2 --datatype=SS]${goto 135}↓ [--startday=2 --datatype=MS]

${execi 600 echo `date --date="3 day" | awk '{print $1" "$3" "$2}'`} → [--startday=3 --datatype=HT] ([--startday=3 --datatype=LT])
${color8}[--startday=3 --datatype=CC]${color}${image [--startday=3 --datatype=WI] -p 0,366 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=3 --datatype=SR]${goto 135}↑ [--startday=3 --datatype=MR]
${goto 60}${color8}→ [--startday=3 --datatype=DL]${color}${goto 135}→ [--startday=3 --datatype=MP]
${goto 60}↓ [--startday=3 --datatype=SS]${goto 135}↓ [--startday=3 --datatype=MS]

${execi 600 echo `date --date="4 day" | awk '{print $1" "$3" "$2}'`} → [--startday=4 --datatype=HT] ([--startday=4 --datatype=LT])
${color8}[--startday=4 --datatype=CC]${color}${image [--startday=4 --datatype=WI] -p 0,464 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=4 --datatype=SR]${goto 135}↑ [--startday=4 --datatype=MR]
${goto 60}${color8}→ [--startday=4 --datatype=DL]${color}${goto 135}→ [--startday=4 --datatype=MP]
${goto 60}↓ [--startday=4 --datatype=SS]${goto 135}↓ [--startday=4 --datatype=MS]

${execi 600 echo `date --date="5 day" | awk '{print $1" "$3" "$2}'`} → [--startday=5 --datatype=HT] ([--startday=5 --datatype=LT])
${color8}[--startday=5 --datatype=CC]${color}${image [--startday=5 --datatype=WI] -p 0,562 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=5 --datatype=SR]${goto 135}↑ [--startday=5 --datatype=MR]
${goto 60}${color8}→ [--startday=5 --datatype=DL]${color}${goto 135}→ [--startday=5 --datatype=MP]
${goto 60}↓ [--startday=5 --datatype=SS]${goto 135}↓ [--startday=5 --datatype=MS]

${execi 600 echo `date --date="6 day" | awk '{print $1" "$3" "$2}'`} → [--startday=6 --datatype=HT] ([--startday=6 --datatype=LT])
${color8}[--startday=6 --datatype=CC]${color}${image [--startday=6 --datatype=WI] -p 0,660 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=6 --datatype=SR]${goto 135}↑ [--startday=6 --datatype=MR]
${goto 60}${color8}→ [--startday=6 --datatype=DL]${color}${goto 135}→ [--startday=6 --datatype=MP]
${goto 60}↓ [--startday=6 --datatype=SS]${goto 135}↓ [--startday=6 --datatype=MS]

${execi 600 echo `date --date="7 day" | awk '{print $1" "$3" "$2}'`} → [--startday=7 --datatype=HT] ([--startday=7 --datatype=LT])
${color8}[--startday=7 --datatype=CC]${color}${image [--startday=7 --datatype=WI] -p 0,758 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=7 --datatype=SR]${goto 135}↑ [--startday=7 --datatype=MR]
${goto 60}${color8}→ [--startday=7 --datatype=DL]${color}${goto 135}→ [--startday=7 --datatype=MP]
${goto 60}↓ [--startday=7 --datatype=SS]${goto 135}↓ [--startday=7 --datatype=MS]

${execi 600 echo `date --date="8 day" | awk '{print $1" "$3" "$2}'`} → [--startday=8 --datatype=HT] ([--startday=8 --datatype=LT])
${color8}[--startday=8 --datatype=CC]${color}${image [--startday=8 --datatype=WI] -p 0,856 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=8 --datatype=SR]${goto 135}↑ [--startday=8 --datatype=MR]
${goto 60}${color8}→ [--startday=8 --datatype=DL]${color}${goto 135}→ [--startday=8 --datatype=MP]
${goto 60}↓ [--startday=8 --datatype=SS]${goto 135}↓ [--startday=8 --datatype=MS]

${execi 600 echo `date --date="9 day" | awk '{print $1" "$3" "$2}'`} → [--startday=9 --datatype=HT] ([--startday=9 --datatype=LT])
${color8}[--startday=9 --datatype=CC]${color}${image [--startday=9 --datatype=WI] -p 0,954 -s 50x50}
${goto 75}Sun${goto 150}Moon
${goto 60}↑ [--startday=9 --datatype=SR]${goto 135}↑ [--startday=9 --datatype=MR]
${goto 60}${color8}→ [--startday=9 --datatype=DL]${color}${goto 135}→ [--startday=9 --datatype=MP]
${goto 60}↓ [--startday=9 --datatype=SS]${goto 135}↓ [--startday=9 --datatype=MS]
${hr}
Updated: [--datatype=LU]
Fetched: [--datatype=LF]

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#31 2014-12-19 15:22:57

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: YAWS: Yet Another Weather Script (cli) (conkyForecast syntax)

OK, got playing with YAWS again today and I noticed something.

Can you confirm please:
1. The site in Norway updates very slowly.
2. For that reason YAWS doesn't have "current" weather conditions.

Take a look at the full conky on the right.  The bottom section with Updates, Fetched, UTC and Local times.

Updated at 04:03 it's now past noon.  sad
2014_12_19_12_19_05_1920x1080_Sector11.jpg


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo