Jump to content
CarlosNZ

TimeZones - a World Clock script filter [updated to v1.7]

Recommended Posts

1 minute ago, Jarek said:

 

Unfortunately, this is "known issue" ☺️ Invoke "timezone update" to get all your defined locations up to date. And not forget doing it again in 6 months ☺️

 

Best regards, Jarek 

Yeah, it's the price you pay for speed. I could have it look up the true time difference every single run, but that wouldn't give instant results.

Share this post


Link to post

For some reason, I see the custom times in 24H format, and not the PM format. I checked the other thread to make sure of AMPM format, and it was correctly set. But it still shows in 24H format even after reloading :/

 

Any ideas?

Share this post


Link to post
2 hours ago, Yourname said:

But it still shows in 24H format even after reloading :/

I don't know the answer but I would take this chance to get comfortable with 24. Am/pm is just an annoyance when you get used to it. There's a reason many countries use 24 including the US military

Share this post


Link to post
5 hours ago, Yourname said:

For some reason, I see the custom times in 24H format, and not the PM format. I checked the other thread to make sure of AMPM format, and it was correctly set. But it still shows in 24H format even after reloading :/

 

Any ideas?

So you're looking in the timezone_list.sh file?

 

You want to make sure this line is as follows:

city_time=$(date -u -j -f %s $city_epochtime +"%l:%M %p") #Create readable time expression

That's the format for AM/PM time. Note that this line is in there twice — one for the main list, and one for custom times.

Share this post


Link to post

Jarek, thanks for the updates. The about page still mentions it being 1.8 even though the changelog has 1.9 in it. Also, I think it's good to reference the website and maybe github location too.

Share this post


Link to post

Hi,

 

I am not getting any good timezone anymore after running timezone update i get zero results. See images. I am currently in China FYI not sure if where my laptop is it creates an issue with the web? I mean i am VPN into a Dallas server, and have always done this timezone check when on VPN...

 

I already uncommented everything on the add city file and the timezone update and here is what i notice. The Add city file doesn't output anything in the xml file...

 

Thanks

 

Miguel

 

 

Screen Shot 2018-04-26 at 1.54.13 PM.png

Screen Shot 2018-04-26 at 1.54.38 PM.png

Share this post


Link to post
Posted (edited)

Hi Miguel,

 

 

Quote

I already uncommented everything on the add city file and the timezone update and here is what i notice

 

Could you please revert to the original versions and give me output from these commands.

 

Go to the Workflows and select Open in Terminal:

 

 

image.png.5c117498c9b3f01a10d5783cc1971a8a.png

 

Then type copy and paste these lines and paste here the output:

cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/timezones.txt"
cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/configExtra"

Then run:

 

sh -x update.sh > ~/Desktop/Update.txt 2>&1

This will provide a lot of output

 

This should create file Update.txt on your desktop - please post it here as well.

 

Thanks and best regards,

Jarek

Edited by Jarek

Share this post


Link to post
7 minutes ago, Jarek said:

Hi Miguel,

 

 

 

Could you please revert to the original versions and give me output from these commands.

 

Go to the Workflows and select Open in Terminal:

 

Then type copy and paste these lines and paste here the output:


cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/timezones.txt"

cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/configExtra"

 

 

Last login: Mon Apr 23 18:19:22 on console

LXXXXXXX:~ a02XXXXXX$ cd /Users/a0274158/Library/Application\ Support/Alfred\ 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/

LXXXXXXX:user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392 a02XXXXXX$ cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/timezones.txt"

Auckland|Auckland|New Zealand|-36.8484597|174.7633315||||UTC+||64

Sydney|Sydney|Australia|-33.8674869|151.2069902||||UTC+||61

New York|New York|United States|40.7143528|-74.0059731||||UTC+|

Los Angeles|Los Angeles|United States|34.0522342|-118.2436849||||UTC+|

London|London|United Kingdom|51.5112139|-0.1198244||||UTC+||44

Paris|Paris|France|48.8566140|2.3522219||||UTC+||33

Tokyo|Tokyo|Japan|35.6894875|139.6917064||||UTC+||81

Beijing|Beijing|China|39.9040300|116.4075260||||UTC+||86

Hong Kong|Hong Kong|Hong Kong|22.3964280|114.1094970||||UTC+||852

Capetown|Cape Town|South Africa|-33.9248685|18.4240553||||UTC+||27

Moscow|Moscow|Russia|55.7496460|37.6236800||||UTC+||7

Dubai|Dubai|United Arab Emirates|25.2711390|55.3074850||||UTC+||971

Munich|Munich|Germany|48.1351253|11.5819805||||UTC+||49

LXXXXXXX:user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392 a0274158$ cat "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/configExtra"

TIME_FORMAT|12h

LXXXXXXX:user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392 a02XXXXXX$ sh -x update.sh > ~/Desktop/Update.txt 2>&1

LXXXXXXX:user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392 a02XXXXXX$ 

 

7 minutes ago, Jarek said:

 


sh -x update.sh > ~/Desktop/Update.txt 2>&1

This will provide a lot of output

 

This should create file Update.txt on your desktop - please post it here as well.

 

 

+ source includes.sh
++ TZWD='/Users/a02xxxxx/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/carlosnz.timezones'
++ TZPREFS='/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones'
++ shopt -s expand_aliases
++ shopt -s nocasematch
++ alias 'growlnotify=/usr/local/bin/growlnotify TimeZones --image icon.png -m '
++ '[' '!' -e '/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/config-1-5' ']'
+++ cat '/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/config-1-5'
++ timezone_file='/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/timezones.txt'
++ '[' '!' -e '/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/timezones.txt' ']'
+ /usr/local/bin/growlnotify TimeZones --image icon.png -m 'Timezones updating. This will take a few moments...'
update.sh: line 3: /usr/local/bin/growlnotify: No such file or directory
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Auckland
+ city_returned=Auckland
+ country='New Zealand'
+ latitude=-36.8484597
+ longitude=174.7633315
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=-36.8484597,174.7633315&timestamp=1524754015&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Auckland|Auckland|New Zealand|-36.8484597|174.7633315||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Sydney
+ city_returned=Sydney
+ country=Australia
+ latitude=-33.8674869
+ longitude=151.2069902
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=-33.8674869,151.2069902&timestamp=1524754015&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Sydney|Sydney|Australia|-33.8674869|151.2069902||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city='New York'
+ city_returned='New York'
+ country='United States'
+ latitude=40.7143528
+ longitude=-74.0059731
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=40.7143528,-74.0059731&timestamp=1524754015&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'New York|New York|United States|40.7143528|-74.0059731||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city='Los Angeles'
+ city_returned='Los Angeles'
+ country='United States'
+ latitude=34.0522342
+ longitude=-118.2436849
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=34.0522342,-118.2436849&timestamp=1524754015&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Los Angeles|Los Angeles|United States|34.0522342|-118.2436849||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=London
+ city_returned=London
+ country='United Kingdom'
+ latitude=51.5112139
+ longitude=-0.1198244
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=51.5112139,-0.1198244&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'London|London|United Kingdom|51.5112139|-0.1198244||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Paris
+ city_returned=Paris
+ country=France
+ latitude=48.8566140
+ longitude=2.3522219
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=48.8566140,2.3522219&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Paris|Paris|France|48.8566140|2.3522219||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Tokyo
+ city_returned=Tokyo
+ country=Japan
+ latitude=35.6894875
+ longitude=139.6917064
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=35.6894875,139.6917064&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Tokyo|Tokyo|Japan|35.6894875|139.6917064||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Beijing
+ city_returned=Beijing
+ country=China
+ latitude=39.9040300
+ longitude=116.4075260
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=39.9040300,116.4075260&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Beijing|Beijing|China|39.9040300|116.4075260||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city='Hong Kong'
+ city_returned='Hong Kong'
+ country='Hong Kong'
+ latitude=22.3964280
+ longitude=114.1094970
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=22.3964280,114.1094970&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Hong Kong|Hong Kong|Hong Kong|22.3964280|114.1094970||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Capetown
+ city_returned='Cape Town'
+ country='South Africa'
+ latitude=-33.9248685
+ longitude=18.4240553
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=-33.9248685,18.4240553&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Capetown|Cape Town|South Africa|-33.9248685|18.4240553||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Moscow
+ city_returned=Moscow
+ country=Russia
+ latitude=55.7496460
+ longitude=37.6236800
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=55.7496460,37.6236800&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Moscow|Moscow|Russia|55.7496460|37.6236800||||UTC+'
+ continue
+ IFS=
+ read -r line
+ OIFS='     
'
+ IFS='|'
+ data=($line)
+ city=Dubai
+ city_returned=Dubai
+ country='United Arab Emirates'
+ latitude=25.2711390
+ longitude=55.3074850
+ offset=
+ tz_id=
+ tz_name=
+ display_offset=UTC+
+ IFS='     
'
+++ date +%s
++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=25.2711390,55.3074850&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''
+ tz_data='
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5
Stack trace:
#0 /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5): SimpleXMLElement->__construct('\'''\'')
#1 {main}
  thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5'
+ tz_data_split=($tz_data)
+ IFS='     
'
+ '[' '!' Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php:5 Stack trace: '#0' /Users/a02xxxxx/Library/Application Support/Alfred '3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php(5):' 'SimpleXMLElement->__construct('\'''\'')' '#1' '{main}' thrown in /Users/a02xxxxx/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484CC0B4-D305-455A-A323-A6CC62C97392/parsexml_timezone.php on line 5 = OK ']'
update.sh: line 31: [: too many arguments
+ raw_offset=
+ dst_offset=
+ new_tz_id=
+ new_tz_name=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ raw_offset=
++ echo '()/1'
++ bc
(standard_in) 1: parse error
+ dst_offset=
++ expr +
expr: syntax error
+ new_offset=
+ '[' = ']'
+ echo 'Dubai|Dubai|United Arab Emirates|25.2711390|55.3074850||||UTC+'
+ continue
+ IFS=
+ read -r line
+ mv -f '/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/update_timezones.txt' '/Users/a02xxxxx/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones/timezones.txt'
+ '[' = 1 ']'
update.sh: line 78: [: =: unary operator expected
+ '[' -z ']'
+ change=0
+ '[' 0 = 1 ']'
+ change_display='0 changes'
+ echo -n 'City list updated successfully, with 0 changes.'
-n City list updated successfully, with 0 changes.
+ '[' 0 -gt 0 ']'
 

Share this post


Link to post

Hi Miguel,

 

The problem is happening around these lines:

 

++ curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=25.2711390,55.3074850&timestamp=1524754016&sensor=false'
+ api_timezone=
+ OIFS='     
'
+ IFS='    '
++ php parsexml_timezone.php ''

As you see, whenever attempting to read the timezone details from the web, curl command does not return any data.

 

I'm guessing it's exactly because of your VPN and the way, how it allows to access the Internet. Most likely, it requires a proxy. Run two tests pls:

 

a) Open this page in a web browser (e.g. Safari or Chrome)

 

https://maps.googleapis.com/maps/api/timezone/xml?location=-36.8484597,174.7633315&timestamp=1524754015&sensor=false

 

b) run this in Terminal

 

curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=-36.8484597,174.7633315&timestamp=1524754015&sensor=false'

Both should generate similar results, but I'm afraid the second returns just nothing.

 

If this is really because of the proxy, in a first step you would need to find out what the proxy is (this depends on you VPN provider or your IT). Then, let's make a test in Terminal:

 

 

export http_proxy=http://<proxy>:<port>/ 

curl --connect-timeout 10 -s 'https://maps.googleapis.com/maps/api/timezone/xml?location=-36.8484597,174.7633315&timestamp=1524754015&sensor=false'

Of course, you need to change http://<proxy>:<port>/ into legit proxy URL.

If this time curl will return something like below:

 

<?xml version="1.0" encoding="UTF-8"?>
<TimeZoneResponse>
 <status>OK</status>
 <raw_offset>43200.0000000</raw_offset>
 <dst_offset>0.0000000</dst_offset>
 <time_zone_id>Pacific/Auckland</time_zone_id>
 <time_zone_name>New Zealand Standard Time</time_zone_name>
</TimeZoneResponse>

Then fixing will be as easy as updating includes.sh by adding the line below:

#includes for TimeZones scripts

#Working Directories
TZWD="$HOME/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/carlosnz.timezones"
TZPREFS="$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones"

CONFIG_EXTRA="$TZPREFS/configExtra"

export http_proxy=http://<proxy>:<port>/   #### ADD THIS LINE WITH PROPER PROXY DETAILS

 

I hope it will help.

Jarek

 

PS: The log you posted above is quite long, perhaps you may want to remove it from the forum and post to e,.g. https://justpaste.it/

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×