Jump to content
bengr

TimeIn - Show the time in a specific location (new & improved)

Recommended Posts

Screen%20Shot%202013-03-31%20at%2013.42.

 

Download (v2.01)

 

I took nirl's workflow and built it upon it, adding an option to see custom locations in Alfred (populated back into Alfred results).

 

Usage:

timein - see the time your default locations (you can setup those in the workflow, easy to remove/add more and modify existing ones).

timein <location> - see the time in the typed in location, including it's flag (without the '<>').

 

Credits:

I've used the flags from CarlosNZ TimeZones workflow (with his permission), so a huge thanks for him for having the flags display faster and correctly now (flags were originally taken from this site, so a huge thanks to them as well).

 

Notes:

Feel free to take any of the code I written for the workflow and use it, but please give proper credit where needed.

 

* Please note that this workflow is no longer in development considering the latest update to the TimeZones workflow, which implements TimeIn as a whole in it. Also, I don't have the time to maintain it as much anymore.

Hopefully you'll continue enjoying the new version of TimeIn in the future, or move over to TimeZones.

Edited by The_Ben

Share this post


Link to post

This is really neat, thanks!

 

One question - I ran the 'timein setup' and updated time.py to include my WolframAlpha AppID but I can't get custom results when I type in queries like "timein London". It just hangs on the "Please wait..." message. If I just type "timein" I can see the time in the default cities - just nothing for the custom locations. Any ideas?

Share this post


Link to post

This is really neat, thanks!

 

One question - I ran the 'timein setup' and updated time.py to include my WolframAlpha AppID but I can't get custom results when I type in queries like "timein London". It just hangs on the "Please wait..." message. If I just type "timein" I can see the time in the default cities - just nothing for the custom locations. Any ideas?

 

Same here bwananmatt 

Share this post


Link to post

Try to run:

sudo easy_install wolframalpha 

in Terminal manually, this is basically what the setup script does.

Edited by The_Ben

Share this post


Link to post

Thanks! I ran the Terminal command and it asked for my password (maybe that's part of the problem with 'timein setup'?) and then it successfully installed the package. Still not working though. When I type "timein London" this is what I get after a while:

 

"L - The class of decision problems solvable by a deterministic Turing"

 

I can't get any other queries to return a result.

 

Here's the Terminal output, if that helps.

---

 

Searching for wolframalpha
Best match: wolframalpha 1.0.2
Processing wolframalpha-1.0.2.zip
Running wolframalpha-1.0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-WfASBT/wolframalpha-1.0.2/egg-dist-tmp-J2trcx
Searching for hgtools
Best match: hgtools 2.0.3
Processing hgtools-2.0.3.zip
Running hgtools-2.0.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-WfASBT/wolframalpha-1.0.2/temp/easy_install-61QHRg/hgtools-2.0.3/egg-dist-tmp-T8AJi6
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3'
zip_safe flag not set; analyzing archive contents...
 
Installed /private/tmp/easy_install-WfASBT/wolframalpha-1.0.2/hgtools-2.0.3-py2.7.egg
Adding wolframalpha 1.0.2 to easy-install.pth file
 
Installed /Library/Python/2.7/site-packages/wolframalpha-1.0.2-py2.7.egg
Processing dependencies for wolframalpha
Finished processing dependencies for wolframalpha

Share this post


Link to post

Thanks! I ran the Terminal command and it asked for my password (maybe that's part of the problem with 'timein setup'?) and then it successfully installed the package. Still not working though. When I type "timein London" this is what I get after a while:

 

"L - The class of decision problems solvable by a deterministic Turing"

 

I can't get any other queries to return a result.

 

Here's the Terminal output, if that helps.

---

Installed /Library/Python/2.7/site-packages/wolframalpha-1.0.2-py2.7.egg
Processing dependencies for wolframalpha
Finished processing dependencies for wolframalpha

Seems to me like the WolframAlpha API was installed successfully, so that's good (as confirmed by the Terminal output, as well as the result you're getting for your query, which are obviously from WolframAlpha, based on their content).

 

Please try to enter another query, not for London (oddly enough, I'm getting the same result as you are at the moment for London). Maybe try:

"timein New Zeland", that seemed to have worked for me just now.

Edited by The_Ben

Share this post


Link to post

That worked - I can get results for countries. I had only been trying cities. Is it possible with cities? It would be kinda nice since many countries are in more than one time zone.

Share this post


Link to post

That worked - I can get results for countries. I had only been trying cities. Is it possible with cities? It would be kinda nice since many countries are in more than one time zone.

It is, as you can see in the second screenshot, which I took just yesterday.

I'll try to look into it, but it's definitely very weird since it worked just fine yesterday.

Edited by The_Ben

Share this post


Link to post

Wow thanks for this. Another app no longer needed.

 

It would be great if you could find out the time on a specific local time / date as well. Then it could be used to arrange meetings. Perhaps something like....

 

timein New York at 8:20

 

timein New York at 16:30 on 12/5/2013

Share this post


Link to post

just curious how do i make it do a post notification instead? Cuz mayb internet is slow and waiting for the query from screen is odd. It would be great, if i can just enter and then when it is ready, it will just show on notification. :) Nice workflow

Something to think about, it definitely make the workflow better in terms of user experience...

Edited by uNdefin3d

Share this post


Link to post

Great workflow, this is exactly what I'd been looking for from the moment I upgraded. I'm running into the same issue as bwanamatt though, entering countries seems to work just fine but entering cities doesn't seem to work. If I alter the scripts for the "default" cities though I'm able to retrieve times... hope that helps and I'm really looking forward to seeing what happens next. Great work again!

Share this post


Link to post

just curious how do i make it do a post notification instead? Cuz mayb internet is slow and waiting for the query from screen is odd. It would be great, if i can just enter and then when it is ready, it will just show on notification. :) Nice workflow Something to think about, it definitely make the workflow better in terms of user experience...

Here's a quick change I made to the existing workflow to work in the said manner - just use it as usual, and it'll output to the Notification Center/Growl. You can download it here.

Also, I noticed that it now works for cities too (and not just for countries), so I'll look into this issue later to try and figure out why Wolfram doesn't like city flags, and make it behave again :).

Edited by The_Ben

Share this post


Link to post

That worked - I can get results for countries. I had only been trying cities. Is it possible with cities? It would be kinda nice since many countries are in more than one time zone.

Fixed the cities issue. You can get the updated version here.

Share this post


Link to post

Wow thanks for this. Another app no longer needed.

 

It would be great if you could find out the time on a specific local time / date as well. Then it could be used to arrange meetings. Perhaps something like....

 

timein New York at 8:20

 

timein New York at 16:30 on 12/5/2013

You mean that in the first query, 8:20 is the time in your location, and you'd get the time in New York for that time? Or the other way around (getting the local time for a given time (8:20 in this case) in New York)?

Share this post


Link to post

I did everything mentioned here successfully :  'timein setup' and updated time.py to include my WolframAlpha AppID (where I registered)

 

In terminal I ran the :  sudo easy_install wolframalpha 

 

I then get a warning message (Improper use of the sudo command lead to data loss bla bla bla )

 

and then it asks for my password, which I can't put in, because the keyboard stops functioning ?!?!

 

Maybe thats what I'm not doing right ???

 

Help :)

Share this post


Link to post

I did everything mentioned here successfully :  'timein setup' and updated time.py to include my WolframAlpha AppID (where I registered)

 

In terminal I ran the :  sudo easy_install wolframalpha 

 

I then get a warning message (Improper use of the sudo command lead to data loss bla bla bla )

 

and then it asks for my password, which I can't put in, because the keyboard stops functioning ?!?!

 

Maybe thats what I'm not doing right ???

 

Help :)

I suppose you never messed around in Terminal before, huh?  ^_^ .

When you're required your admin password, you don't see the input. So just type it in, trusting that the keyboard works, and press return when you're finished, you should see the command running.

Share this post


Link to post

OMG LOL BUSTED !!!

 

Are you serious (I can't stop laughing)

 

Ok thanks here I go .......I have to say though : I am willing to learn ... :ph34r:

Share this post


Link to post

OMG LOL BUSTED !!!

 

Are you serious (I can't stop laughing)

 

Ok thanks here I go .......I have to say though : I am willing to learn ... :ph34r:

No problem, there's always a first time for everything, even executing a command in Terminal :).

Share this post


Link to post

Here's a quick change I made to the existing workflow to work in the said manner - just use it as usual, and it'll output to the Notification Center/Growl. You can download it here.

Also, I noticed that it now works for cities too (and not just for countries), so I'll look into this issue later to try and figure out why Wolfram doesn't like city flags, and make it behave again :).

 

Great! Superb :)

Share this post


Link to post

Great workflow – thanks!  :)

 

Is it possible to change the 12-hour-system (am/pm) to the 24-hour-system?  :huh:

The workflow currently relies on WolframAlpha for getting it's data. From my testing, it only shows time in 12-hour format unfortunately (I'd also like it to be location-based, or somehow be able to get the time in a 24 hour format).

I'll have to look into other services and see if they're able to retrieve the time in other formats, or build something to convert 12 hours format to a 24-hour one.

 

In any case, I'll look into it when I have the time.

Share this post


Link to post

You mean that in the first query, 8:20 is the time in your location, and you'd get the time in New York for that time? Or the other way around (getting the local time for a given time (8:20 in this case) in New York)?

 

 

I mean 8:20 is the local time and it tells me the time in New York when it is 8:20 local time. Adding dates could take into account daylight saving...

 

 

timein New York at 16:30 on 12/5/2013

 

Would mean "when it is 16:30 on 12th May 2013 local time, what time would it be in New York".

 

I guess if you wanted to support conversions to local time you could use a different keyword...

 

localtime New York at 16:30

 

Would mean "what is the local time when it is 16:30 in New York"

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...