bengr Posted March 16, 2013 Posted March 16, 2013 (edited) 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 March 31, 2013 by The_Ben nirl 1
bwanamatt Posted March 16, 2013 Posted March 16, 2013 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?
ChrisHumphreys Posted March 16, 2013 Posted March 16, 2013 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
bengr Posted March 16, 2013 Author Posted March 16, 2013 (edited) Try to run: sudo easy_install wolframalpha in Terminal manually, this is basically what the setup script does. Edited March 16, 2013 by The_Ben
bwanamatt Posted March 16, 2013 Posted March 16, 2013 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 Reading http://pypi.python.org/simple/wolframalpha/ Reading https://bitbucket.org/jaraco/wolframalpha Best match: wolframalpha 1.0.2 Downloading http://pypi.python.org/packages/source/w/wolframalpha/wolframalpha-1.0.2.zip#md5=8b1b4597ed44aff457eb5638961d9e79 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 Reading http://pypi.python.org/simple/hgtools/ Reading http://bitbucket.org/jaraco/hgtools/ Reading http://bitbucket.org/jaraco/hgtools/downloads/ Best match: hgtools 2.0.3 Downloading http://pypi.python.org/packages/source/h/hgtools/hgtools-2.0.3.zip#md5=1ebc90712ec823fe0f8efa7636eb31d7 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
bengr Posted March 16, 2013 Author Posted March 16, 2013 (edited) 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 March 16, 2013 by The_Ben
bwanamatt Posted March 16, 2013 Posted March 16, 2013 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.
bengr Posted March 16, 2013 Author Posted March 16, 2013 (edited) 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 March 16, 2013 by The_Ben
froamer Posted March 20, 2013 Posted March 20, 2013 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
uNdefin3d Posted March 21, 2013 Posted March 21, 2013 (edited) 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 March 21, 2013 by uNdefin3d
Jonathan Tom Posted March 22, 2013 Posted March 22, 2013 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!
bengr Posted March 22, 2013 Author Posted March 22, 2013 (edited) 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 March 22, 2013 by The_Ben
bengr Posted March 22, 2013 Author Posted March 22, 2013 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. shiftjam 1
bengr Posted March 22, 2013 Author Posted March 22, 2013 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)?
bwanamatt Posted March 22, 2013 Posted March 22, 2013 Fixed the cities issue. You can get the updated version here. Thanks!
shiftjam Posted March 22, 2013 Posted March 22, 2013 Fixed the cities issue. You can get the updated version here. Great job!
BabaOo Posted March 22, 2013 Posted March 22, 2013 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
bengr Posted March 22, 2013 Author Posted March 22, 2013 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.
BabaOo Posted March 22, 2013 Posted March 22, 2013 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 ...
bengr Posted March 22, 2013 Author Posted March 22, 2013 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 ... No problem, there's always a first time for everything, even executing a command in Terminal .
BabaOo Posted March 22, 2013 Posted March 22, 2013 (edited) workin' now Thanks very cool workflow as I have friends all over this planet !!! Edited March 22, 2013 by BabaOo
uNdefin3d Posted March 22, 2013 Posted March 22, 2013 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
dan_djorgi Posted March 23, 2013 Posted March 23, 2013 Great workflow – thanks! Is it possible to change the 12-hour-system (am/pm) to the 24-hour-system? DJay 1
bengr Posted March 23, 2013 Author Posted March 23, 2013 Great workflow – thanks! Is it possible to change the 12-hour-system (am/pm) to the 24-hour-system? 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. dan_djorgi and DJay 2
froamer Posted March 26, 2013 Posted March 26, 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)? 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"
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now